In code that I wrote with the help of a video on YouTube (https://www.youtube.com/watch?v=7aDG3L-bTS8), my orderBy and where clauses are in conflict for some reason unknown to me. The following code works (presumably because I added manual indexing already):
// Query Rule Example
const rule = where("company", "==", "Super Pizza Magic")
// Ordering Example
const order = orderBy("creationTimestamp")
// Querying the Collection Using a Query Rule
const querier = query(reference, order)
As does this code:
// Query Rule Example
const rule = where("company", "==", "Super Pizza Magic")
// Ordering Example
const order = orderBy("creationTimestamp")
// Querying the Collection Using a Query Rule
const querier = query(reference, rule)
But THIS code causes the exception identified by Jason:
// Query Rule Example
const rule = where("company", "==", "Super Pizza Magic")
// Ordering Example
const order = orderBy("creationTimestamp")
// Querying the Collection Using a Query Rule
const querier = query(reference, rule, order)
Thus, I cannot seem to filter by company while ordering by creationTimestamp.
Can someone help me understand what I've done wrong here, please?
UPDATE: know the link suggested the video would contain such an error, but that was unfortunately not the case for me. Instead, I tried to manually create the index that the link I was supposed to have seen would have created by going to Indexing under the Firestore section in the Firebase Console, and that is how I was able to get the orderBy method to work properly... however, it still won't work if I try using both, as mentioned above.
FURTHER UPDATE: Someone closed my question and linked to irrelevant questions as the reasoning for doing so... those similar but slightly different errors and very different code situations do not contain obvious answers to my unique error. I would appreciate it if this were left open so my unique error could be addressed by someone who knows this situation well. Thanks.