So after some Mongo Update in Meteor v1.8 (I think so at least), I am running into weird Mongo Errors.
What I did:
meteor update
meteor reset
-
mongorestore
my whole DB
When I know run this part of code on my server I get an error:
// unset meta attrs for next run
try {
await Items.update({ supplier_id: supplierId }, { $unset: { 'meta.just_updated': '', 'meta.just_reset_units': '' } }, { multi: true });
} catch(err) {
console.error('unset just_updated ERROR:', err);
};
ERROR:
unset just_updated ERROR: { MongoError: Updating the path 'meta' would create a conflict at 'meta'
W20181015-10:49:52.762(2)? (STDERR) at Function.create (/Users/patrick/.meteor/packages/npm-mongo/.3.1.1.94mqgq.ukc0e++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/mongodb-core/lib/error.js:43:12)
...
I then googled and found this: https://stackoverflow.com/questions/51827085/migrating-to-meteor-1-7-0-4-mongodb-updating-the-path-would-create-a-co
So I tried running db.adminCommand( { setFeatureCompatibilityVersion: "3.4" } )
in mongo shell and my code works again.
Can somebody help? What is wrong here? I am confused.
best, Patrick