Created
November 2, 2017 14:05
-
-
Save musukvl/e9aa17d5a4ccdcbfd7c386065c5ee93b to your computer and use it in GitHub Desktop.
Mongo Query to insert 100000 log records
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
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