Error : Firestore collection give error with " where & orderBy "

367 views
Skip to first unread message

Manisha S

unread,
Feb 7, 2021, 3:27:10 PM2/7/21
to Firebase Google Group
Hi there,

I am getting an error when using "where & orderBy " in firestore collection query.
I am using firestore db in react native app.

below is My function:

getCurrentUser = async () => {
    var ptyid = this.props.navigation.state.params.PartyId;
    const ref = await firebase
      .firestore()
      .collection('Transaction')
      .orderBy('EntryDate', 'desc')
      .where('PartyId', '==', ptyid);
  };

Error is :
Error : firestore operation was rejected because the system is not in a state required for the operation's execution.(firestore/failed-precondition).)

can you please guide me

Kato Richardson

unread,
Feb 8, 2021, 10:34:37 AM2/8/21
to Firebase Google Group
Hi Manisha,

That function isn't actually doing anything; creating a reference is fairly minimal and shouldn't be affecting much. How did you verify the error is coming from that particular code? Are you on the latest version? What environment is that running in?

☼, Kato

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/3b4d83df-892d-4a49-9816-d1be36008cd1n%40googlegroups.com.


--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

Reply all
Reply to author
Forward
0 new messages