This error can occur if you insert documents through a different client than deployd.
From here:
MongoDB uses ObjectIds as the default value for the _id field if the _id field is not specified ... if a client does not add an _id field, mongod will add an _id field that holds an ObjectId.
Although the IDs created by mongoDB are visible in the deployd dashboard, they are not normal strings (like the IDs generated by deployd) and deployd does not find them when it's looking for a string.
Try to run a query like the following with any other mongoDB client (e.g. Robomongo):
db.yourcollection.find({_id: ObjectId("some_id_you_know_exists_in_collection")})
If it does not throw an error, the id is most likely an ObjectId that was not created by deployd.
Unfortunately, there is no easy fix. (At least not for big collections and complicated apps.)
For SMALL collections I'd suggest to just duplicate the data into a new collection and let deployd create new IDs.
Quick, dirty and untested:
dpd.collection.get({}, function(res) {
_.each(res, function(object){
object.oldId = object.id //add id backup
delete object.id
// post new object without id -> deployd creates a new id
dpd.newcollection.post(object, function(res, err) {
if(err) {
console.log(err);
};
if(res) {
console.log(res);
};
})
});
})
You have to decide for yourself if that works for you.