You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to upload a Geopoint data type in Node JS program but the upload is unsuccessful.
I expect the Geopoint datatype to be successfully updated.
Actual behavior
Argument "data" is not a valid Document. Detected an object of type "GeoPoint" that doesn't match the expected instance (found in field destinationCoordinates). Please ensure that the Firestore types you are using are from the same NPM package.
Configuration:
$ nvm ls
v8.9.4
-> v8.13.0
system
Steps to reproduce the behavior
Create a script named firestore-import.js with the following content:
const firestoreImportExport = require('./node_modules/node-firestore-import-export');
function setupDBConnection(isReleaseConfig) {
var sa = serviceAccount;
var db = databaseURL;
if (isReleaseConfig) {
sa = prodServiceAccount;
db = prodDatabaseURL;
}
admin.initializeApp({
credential: admin.credential.cert(sa),
databaseURL: db
});
}
async function main () {
const rootDocumentPath = process.argv[2];
const fullLocalPath = process.argv[3];
setupDBConnection(false);
const collectionRef = admin.firestore().collection(rootDocumentPath);
const jsonString = fs.readFileSync(fullLocalPath, 'utf8');
const serializedData = JSON.parse(jsonString, null, 2);
await firestoreImportExport.firestoreImport(serializedData, collectionRef, false).then( () => {
console.log(`{ ${fullLocalPath} } data was imported into root collection { ${rootDocumentPath}}
}`);
});
}
Everything is fine if I remove the "_datatype_": "geopoint" thing except it is not stored as a Geopoint into Firestore.
When I add it I am getting the above error.
The text was updated successfully, but these errors were encountered:
When exporting then importing, I get no problem but the export loses the Geopoint data type information (thus importing after leads to non Geopoint type being imported):
Expected behavior
I am trying to upload a Geopoint data type in Node JS program but the upload is unsuccessful.
I expect the Geopoint datatype to be successfully updated.
Actual behavior
Argument "data" is not a valid Document. Detected an object of type "GeoPoint" that doesn't match the expected instance (found in field destinationCoordinates). Please ensure that the Firestore types you are using are from the same NPM package.
Configuration:
Steps to reproduce the behavior
Everything is fine if I remove the "_datatype_": "geopoint" thing except it is not stored as a Geopoint into Firestore.
When I add it I am getting the above error.
The text was updated successfully, but these errors were encountered: