I'm using Flutter and Firestore. Suppose my database looks like this:
[
{
Name: 'John',
Address: {
Street: "John doe street"
Postal: "12047"
}
},
{
Name: 'Mary',
Address: {
Street: "Fleet street"
Postal: "1242B"
}
}
]
I now would like to search for all persons whose postal code contains '12'. So that would mean both records in this dummy database.
But how can I filter on the nested field 'Address.Postal'?
var ref = FirebaseFirestore.instance;
var query = '12';
ref.collection('users')
.where(
'Address.Postal', // Won't work
... // There is no 'like' operator or something that looks alike
);
FYI the project being in Flutter is irrelevant.