I'm using google Firestore as my database, I wanted to order my material table by two fields (name and date) so I can have it in alphabetical order + in the date it was created, however I got the following error:
This is my code with "acudiente" being the name of the user and "fecha" being the date of the order and "pedidos" being the collection.
useEffect(() => {
const usuariosRef = db.collectionGroup('pedidos')
usuariosRef.orderBy("acudiente", "fecha").onSnapshot(snapshot => {
const tempData = [];
snapshot.forEach((doc) => {
const data = doc.data();
tempData.push(data);
console.log(tempData)
});
setPedidos(tempData);
})
}, []);