Skip to content

Commit

Permalink
This will correctly generate random numbers (TechEmpower#5893)
Browse files Browse the repository at this point in the history
  • Loading branch information
msmith-techempower authored Jul 22, 2020
1 parent 9a9b244 commit bc7f836
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion toolset/databases/mongodb/create.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use hello_world
db.world.drop()
for (var i = 1; i <= 10000; i++) {
db.world.save( { _id: i, id: i, randomNumber: (Math.min(Math.floor(Math.random() * 10000) + 1), 10000) })
db.world.save( { _id: i, id: i, randomNumber: Math.min(Math.floor(Math.random() * 10000) + 1, 10000) })
}

db.world.createIndex({_id: 1})
Expand Down

0 comments on commit bc7f836

Please sign in to comment.