Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To query maps nested within an array field in Firebase, you can use the array-contains query method.

For example, let's say you have a collection of users, and each user document has an addresses field that is an array of maps containing the user's various addresses. To query for users who have an address in a specific city (let's say "San Francisco"), you can use the following code:

db.collection("users").where("addresses", "array-contains", { city: "San Francisco" })

This will return all user documents that have at least one address map with a "city" key that is equal to "San Francisco".