I am looking at the Firebase Cloud Firestore documentation for orderBy. When I try to execute this
var facultyQuery = facultyRef.where("department", "==", "Core Teacher").orderBy('bb_last_name', 'desc');
I get the error:
Error: Firestore: Operation was rejected because the system is not in a state required for the operation`s execution. (firestore/failed-precondition).
Both of these simpler cases work just fine:
var facultyQuery = facultyRef.orderBy('bb_last_name', 'asc');
var facultyQuery = facultyRef.where("department", "==", "Core Teacher");
But when I combine the where and the orderBy, something I have done before with other Firestore collections, it fails.
department
andbb_last_name
? You should get a better error message than this if you forgot, but I'd like to make sure.orderBy
that makes me think it might. But it would usually give a very clear message about that.