Last active
December 20, 2015 00:59
-
-
Save kizzx2/6045673 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 docs = []; | |
| for(var i = 0; i < 20000; i++) { | |
| docs.push({rnd: _rand(), t: "2013-06-23", N:7*i, A:1, V:0, n:"1234"}); | |
| } | |
| docs.sort(function(a, b) { | |
| return a.rnd - b.rnd; | |
| }); | |
| var t0 = Date.now(); | |
| db.foos.insert(docs); | |
| db.getLastError(); | |
| var t1 = Date.now(); | |
| print(db.foos.find().count() + " documents inserted"); | |
| print("Took " + (t1 - t0) + "ms"); |
This file contains hidden or 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
| MongoDB shell version: 2.4.5 | |
| connecting to: test | |
| 20000 documents inserted | |
| Took 471ms |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment