Reputation: 477
In my functions I have the following:
await admin.firestore()
.collection("development")
.doc("development")
.collection("users")
.doc(userId)
.collection("tokens")
.doc("{autoId}")
.set(token, {merge: true});
In the tokens collection, I want to create a document with an autoID. Everything else seems to be working fine. However, when I check my firestore, the document is named {autoId} instead of generating an actual ID.
Any help is appreciated! :)
Upvotes: 0
Views: 145
Reputation: 3499
Just leave the argument to the last .doc blank - i.e. .doc()
. "{autoId}" is NOT a flag to Firestore - it's just a string.
Upvotes: 2