There was an error updating your document. Please review your changes and try again.
xareelee opened this issue · 8 comments
I used mongol to update data. When I pressed Save
, it showed an alert "There was an error updating your document. Please review your changes and try again."
The console prints:
I20161123-12:21:03.843(8)? Exception while invoking method 'Mongol_update' Error: Meteor requires document _id fields to be non-empty strings or ObjectIDs
I20161123-12:21:03.843(8)? at [object Object].insert (packages/mongo/collection.js:479:13)
I20161123-12:21:03.843(8)? at Object.Mongol.insertDoc (packages/msavin_mongol.js:185:32)
I20161123-12:21:03.844(8)? at [object Object].Meteor.(anonymous function).Mongol_insert (packages/msavin_mongol.js:210:3728)
I20161123-12:21:03.844(8)? at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1711:12)
I20161123-12:21:03.845(8)? at packages/ddp-server/livedata_server.js:1624:18
I20161123-12:21:03.845(8)? at [object Object]._.extend.withValue (packages/meteor.js:1122:17)
I20161123-12:21:03.845(8)? at Server.apply (packages/ddp-server/livedata_server.js:1623:45)
I20161123-12:21:03.845(8)? at Server.call (packages/ddp-server/livedata_server.js:1566:17)
I20161123-12:21:03.846(8)? at [object Object].Meteor.(anonymous function).Mongol_update (packages/msavin_mongol.js:210:2021)
I20161123-12:21:03.846(8)? at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1711:12)
Is it a bug or what did I do wrong?
I use external MongoDB (export MONGO_URL=<url> && meteor
).
The same issue on #88. Reinstalling meteortoys:allthings
doesn't solve this problem.
@msavin right, my _id
is an ObjectID
not a string in the MongoDB.
How to convert the existing _id
to string values from an ObjectID
type? And how to make mongo create new items with a string type of _id
?
@msavin sorry for the lack of answer in my original issue, didn't see the notification. Reinstalling doesn't help and I also have ObjectID
in my _id
This is now working with the new Mongol 4.0. Just update the package and you should be good to go :)
Meteor Toys has also been patched up to work in these situations, I will be sending the new keys out shortly.
If you run into any issues, please let me know.
@msavin I'm still getting this issue with my collections, and am running 4.0.0. The error stack is filled with packages, so not sure what I could do?
Exception while invoking method 'Mongol_update' { stack: 'Error: Expected \'name\' to be a modifier operator like \'$set\'\n at /Users/Florian/dev/epotek/node_modules/simpl-schema/dist/doValidation.js:312:15\n
at Function._.each._.forEach (/Users/Florian/dev/epotek/node_modules/underscore/underscore.js:158:9)\n
at checkModifier (/Users/Florian/dev/epotek/node_modules/simpl-schema/dist/doValidation.js:309:26)\n
at doValidation (/Users/Florian/dev/epotek/node_modules/simpl-schema/dist/doValidation.js:349:5)\n
at ValidationContext.validate (/Users/Florian/dev/epotek/node_modules/simpl-schema/dist/ValidationContext.js:216:57)\n
at [object Object].doValidate (packages/aldeed:collection2-core/collection2.js:399:33)\n
at [object Object].Mongo.Collection.(anonymous function) [as update] (packages/aldeed:collection2-core/collection2.js:187:25)\n
at [object Object].Meteor.(anonymous function).Mongol_update (packages/msavin_mongol.js:40:2919)\n
at [object Object].methodMap.(anonymous function) (packages/meteorhacks_kadira.js:2731:30)\n
at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1768:12)',
I20170824-15:01:14.230(2)? source: 'method' }
I confirm the issue still comes up using Mongol
4.0.1, and meteortoys:allthings@4.0.0
.