简体   繁体   中英

Firebase Query with where

How can I do query with where in firebase? For example I want to access to the nameL of locationEvent in the estructure of the photo.

I am using flutter to code my app.

火力基地照片

As shown in the doc , you can do as follows:

// Create a reference to the collection
final collectionRef = db.collection('collectionName');

// Create a query against the collection.
final query = collectionRef.where('locationEvent.${nameL}', isEqualTo: 'jkn');

// Execute the query
query.get().then(
  (res) => print("Successfully completed"),
  onError: (e) => print("Error completing: $e"),
);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM