-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
confirmedWe want to fix or implement itWe want to fix or implement it
Description
Calls to update()
on pre-existing mongodb records which use ObjectId()
for their _id
are ignored. _Mongo.prototype.update
passes the string representation of the ObjectId()
to collection.update()
.
As a result, update()
doesn't match any record. This doesn't raise any error - the update is silently ignored by the server, and the change reverted on the client.
Not sure what should be changed, but at the minimum it would be nice to be able to debug this more easily.
In my case, I've converted the _ids in my database to strings:
db.applications_hackers.find({}).forEach(function(app){
db.applications_hackers.remove({_id:app._id});
app._id = app._id.toString();
db.applications_hackers.insert(app);
});
Metadata
Metadata
Assignees
Labels
confirmedWe want to fix or implement itWe want to fix or implement it