Advertisement
Guest User

Untitled

a guest
Feb 13th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. function addUUIDToCollection(collectionName) {
  2. col = db.getCollection(collectionName);
  3. col.find({ uuid: { $exists: false } }).forEach( function (doc) { doc["uuid"] = JUUID(guid()); col.save(doc); });
  4. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement