Skip to content
Advertisement

Firebase 9(modular sdk web ) replacement for fieldPath

I am using the below code with the Firebase SDK 8.

JavaScript

I want to replace it code with the modular SDK. So I have written,

JavaScript

But somehow I could not find the syntax to get the FieldPath. From the reference, I can read that,

JavaScript

which is imported with

JavaScript

But when I am using it, it results in an error.

Does anyone know what is the correct syntax for this?

Thanks

EDIT – 1 Here is the code I am using to get the documents from firestore

JavaScript

getRecordsByIds is the entry point.

Advertisement

Answer

Your syntax looks correct and is working. Just replace the ??? with documentId(). Did you forget the () by chance?

JavaScript

Firebase JS SDK version: 9.0.0-beta.6

The problem seems to be here:

JavaScript

Assign the query to a variable and then return it:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement