I am trying to create collections and sub collections for document inside a collection dynamically from cloud functions, But I am getting following exception **
Argument "collectionPath" must point to a collection, but was "data/c2f7c4e84366". Your path does not contain an odd number of components
**
Logs -
Error: Argument "documentPath" must point to a document, but was "exports/user343434_inbox/profile". Your path does not contain an even number of components. at Firestore.doc (/user_code/node_modules/firebase-admin/node_modules/@google-cloud/firestore/src/index.js:282:13) at admin.firestore.doc.set.then.ws (/user_code/lib/index.js:28:53)
code snippet:
const p = admin.firestore().doc(exports/${userInboxCollectionName}/profile
).set(reqData, { merge: false })
*
I am expecting cloud function to create the subcollection(userid_inbox) inside exports collection(already exists) dynamically if not exists and add the profile document.