lmcq / firebase-firestorm

Firebase Firestorm is an ORM for Firestore which can be used with Typescript.
MIT License
252 stars 19 forks source link

How to create a query using where with Reference Field #18

Closed Kronhyx closed 4 years ago

Kronhyx commented 4 years ago

I got something like this

  async findByUser(ref: IDocumentRef<UserModel>) {

    const snapshot = await Collection(WalletModel).query()
      .where('user', '==', ref).get();

    return snapshot.docs;
  }

and it is generating this error

FirebaseError: Function Query.where() called with invalid data. Unsupported field value: a custom DocumentRef object