The _id's are generated by the driver not mongodb. You can assign any
value you want to the _id field as long as it's a valid BSON type and
is unique. the driver assigns one for you in case you don't have one
for convenience. So no need to hack anything.
collection.insert({_id : "12345678123456781234567812345678", field:
'1'}, {safe:true}, function(err, result) {
test.equal(null, err);
collection.find({_id :
"12345678123456781234567812345678"}).toArray(function(err, items) {
test.equal(null, err);
test.equal(items[0]._id, "12345678123456781234567812345678")
test.equal(items[0].field, '1')
finished_test({insert_doc_with_uuid:'ok'});
})
});