Skip to content

Instantly share code, notes, and snippets.

@musukvl
Created November 2, 2017 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save musukvl/e9aa17d5a4ccdcbfd7c386065c5ee93b to your computer and use it in GitHub Desktop.
Save musukvl/e9aa17d5a4ccdcbfd7c386065c5ee93b to your computer and use it in GitHub Desktop.
Mongo Query to insert 100000 log records
var start = new Date();
for (var i = 1; i <= 100000; i++) {
db.getCollection('log').insert({
"key": (new ObjectId()).toString(),
"data": "some random data: " + (new ObjectId()).toString(),
"updated_date": new Date()
})
}
print(new Date() - start);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment