The current workaround would be to get the Firestore collection's ref property and invoke the where method:
// I haven't tried this yet! It might not work - the code below was manually typed out by hand on GitHub's editor
this.recentChats$ = this.publicChatsCollection.ref.where(/* ... */);
However, this loses on the benefits of AngularFire's observers.
Actual behavior
It is currently not possible to append additional queries to a collection reference.
Version info
Angular: 9.0.2
Firebase: 7.13.1
AngularFire: 6.0.0
Other (e.g. Ionic/Cordova, Node, browser, operating system): NodeJS 13, Chrome 83.0.4103.61, macOS 10.14.6
How to reproduce these conditions
Failing test unit, Stackblitz demonstrating the problem
Steps to set up and reproduce
It's currently not possible to add additional queries after a Firestore collection reference is created.
(For context, I'm creating the ability to view recently added chat groups in the past month which are public.)
Sample data and security rules
Debug output
Errors in the JavaScript console: NIL
Output from
firebase.database().enableLogging(true);
: N.A.Screenshots: N.A.
Expected behavior
There should be the ability to add additional queries after a Firestore collection reference is created, something like below:
The current workaround would be to get the Firestore collection's
ref
property and invoke thewhere
method:However, this loses on the benefits of AngularFire's observers.
Actual behavior
It is currently not possible to append additional queries to a collection reference.