I am using jest to perform integration tests to firestore. I expected to receive document consisting of fields equal to field1 and field2. However, I have received the below error instead.
I have tried creating a composite index in firecase console but the problem still persists. This situation seems to only happen during testing as the code works fine when I run the Node.js app normally. I have narrowed the error to come from the code below:
const response = await fs.collection('collection1').where('field1', '==', field1).where('field2', '==', field2).get();
The error message is as such:
Error: FirebaseError: [code=invalid-argument]: Document parent name "projects/int-test-1-5tb01cf1-poiu-0qa8-lk87-e1aeff685f2d/databases/(default)" lacks "/" at index 76.