firebase-mock icon indicating copy to clipboard operation
firebase-mock copied to clipboard

DocumentReference do not match with query

Open starhoshi opened this issue 6 years ago • 1 comments

I can not get data with a query using DocumentReference.

This code, I can get data with a real Firestore, but can not get it using firebase-mock.

mockFirestore.autoFlush()
const user = await mockFirestore.collection('user').add()
const friend = await mockFirestore.collection('friend').add({user: user})

const fetched = await firestore.collection('friend')
    .where('user', '==', user) // Reference Query
    .get()

console.log(fetched.docs.length) // => 0

starhoshi avatar Apr 11 '18 01:04 starhoshi

I'd like to add my support to this. It makes unit tests needlessly complex when firebase-mock doesn't support this type of query.

ollietreend avatar Feb 04 '19 12:02 ollietreend