How can I use the .where() in FlutterFire to perform queries for Firestore? Because the docs and example doesn\'t cover this I\'m confused. I haven\'t found other questions
Example below go through every document in the collection 'fields', and filter on 'grower`. There is no documentation on that, but you may check the source code.
import 'package:cloud_firestore/cloud_firestore.dart';
Firestore.instance.collection('fields').where('grower', isEqualTo: 1)
.snapshots().listen(
(data) => print('grower ${data.documents[0]['name']}')
);
From source code:
Query where(
String field, {
dynamic isEqualTo,
dynamic isLessThan,
dynamic isLessThanOrEqualTo,
dynamic isGreaterThan,
dynamic isGreaterThanOrEqualTo,
bool isNull,
}) {..}