Created
February 18, 2011 16:48
-
-
Save mediocretes/833961 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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