Angular: 4.4.3
Firebase: 4.6.0
AngularFire: 5.0.0-rc.3
Other (e.g. Ionic/Cordova, Node, browser, operating system):
Ionic-angular: 3.7.1
Steps to set up and reproduce
The doc at https://github.com/angular/angularfire2/blob/master/docs/firestore/querying-collections.md shows an example, which is:
// WARNING: Do not copy and paste. This will not work!
ref.where('tags.awesome', '==', true).orderBy('population')
But the reason for it no to work, as stated by the docs is that "Range filters / orderBy cannot be used in conjunction with user-defined data, they require composite indexes be defined on the specific fields."
This lead me to thinking that I could query subcollections because the tags.awesome made me belive that 'tags' is a subcollection of whatever collection you're querying and 'awesome' is a property of said collection. This is the code that I used for testing:
let ordersWithOffersCollection = this.afs.collection('orders', ref => ref.where('offers.price', '==', 150));
return ordersWithOffersCollection.snapshotChanges()
.map(actions => {
return actions.map(a => {
const data = a.payload.doc.data();
return data;
});
});
I have a order collection with a offer subcollection, the result that I get from logging the return of the function is this:

Oh, and I do have an offer document with a price equal to 150. And this is the code used to log:
let x = this.orderService.getOrdersWithMyOffers();
x.subscribe(val => {
console.log(val);
})
Either my code is wrong or the docs have a weird information.
Any ideas?
Tags in this case is an map type, rather than a subcollection. .awesome being dynamic user-defined data, which is not indexed. I pulled this section straight from the Firestore documentation here https://firebase.google.com/docs/firestore/solutions/arrays
They seemed to have cleaned up the language since. I'll pull in their changes.
haha very interesting, but is that issue is no more issue? can we close? 馃ぃ @guilhermehto
Most helpful comment
Tags in this case is an map type, rather than a subcollection.
.awesomebeing dynamic user-defined data, which is not indexed. I pulled this section straight from the Firestore documentation here https://firebase.google.com/docs/firestore/solutions/arraysThey seemed to have cleaned up the language since. I'll pull in their changes.