Forum

Notifications
Clear all

Firestore queries


appsfactories
(@appsfactories)
New Member
Joined: 2 years ago
Posts: 2
Topic starter  
import 'package:cloud_firestore/cloud_firestore.dart';

final usersRef = Firestore.instance.collection('users');

getUsers() async {
final QuerySnapshot snapshot = await usersRef
.limit(1)
//.orderBy('postsCount', descending: false)
//.where('username', isEqualTo: 'Fred')
//.where('postsCount', isLessThan: 3)
.getDocuments();
snapshot.documents.forEach((DocumentSnapshot doc) {
print(doc.data);
print(doc.documentID);
print(doc.exists);
});
}


Quote
Topic Tags
Share: