I'm trying to add a new Firestore document in asyncData, which may be wrong to begin with, but perhaps someone can help me figure out what's happening here in case this should be working.
Error [FirebaseError]: Function addDoc() called with invalid data. Data must be an object, but it was: a custom Object object (found in document items/umQdLWadRdLjFxbG2cpc)>
at new FirestoreError (.../node_modules/@firebase/firestore/dist/index.node.cjs.js:266:28)
at createError (.../node_modules/@firebase/firestore/dist/index.node.cjs.js:22270:12)
at ParseContext.createError (.../node_modules/@firebase/firestore/dist/index.node.cjs.js:21828:16)
at validatePlainObject (.../node_modules/@firebase/firestore/dist/index.node.cjs.js:22195:27)
at parseSetData (.../node_modules/@firebase/firestore/dist/index.node.cjs.js:21885:5)
at addDoc (.../node_modules/@firebase/firestore/dist/index.node.cjs.js:22546:18)
at CollectionReference$1.add (.../node_modules/@firebase/firestore/dist/index.node.cjs.js:25005:16)
at asyncData (pages/items.js:270:75) {
code: 'invalid-argument',
toString: [Function (anonymous)]
}
It seems like the sentinel object for the timestamp isn't liked by the api. Is there a different way to achieve this?
I'm trying to add a new Firestore document in asyncData, which may be wrong to begin with, but perhaps someone can help me figure out what's happening here in case this should be working.
This is basically the call:
And the result:
It seems like the sentinel object for the timestamp isn't liked by the api. Is there a different way to achieve this?