Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function addUUIDToCollection(collectionName) {
- col = db.getCollection(collectionName);
- col.find({ uuid: { $exists: false } }).forEach( function (doc) { doc["uuid"] = JUUID(guid()); col.save(doc); });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement