Skip to content

Instantly share code, notes, and snippets.

@mediocretes
Created February 18, 2011 16:48
Show Gist options
  • Save mediocretes/833961 to your computer and use it in GitHub Desktop.
Save mediocretes/833961 to your computer and use it in GitHub Desktop.
i = 0;
print("View load: " + db["Views." + x].find({ created_at:{ $exists:true}}).count());
db["Views." + x].find({ created_at:{ $exists:true}}).forEach(function(y){
y.timestamp = y.created_at;
delete y['created_at'];
db["Views." + x].save(y);
});
//OR:
db["Views." + x].remove({ created_at:{ $exists:true}});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment