Skip to content
Advertisement

How can I retreive values from firebase (one to many relationship)?

[![enter image here][

JavaScript
JavaScript
JavaScript

I can’t access name, imageurl and other properties because snapshot.getvalue returns true How can I retreive values from firebase having one to many relationship?

Advertisement

Answer

You’re trying to read the name, description and other properties from the "item01": true node. That won’t work, since the properties don’t exist on that node.

You’ll instead need to load the snapshot for that specific item, and then read the properties from that. This is fairly non-trivial so I highly recommend using the setIndexedQuery method that was specifically made for this case.

Advertisement