Browse Source

This will correctly generate random numbers (#5893)

Mike Smith 5 years ago
parent
commit
bc7f836cac
1 changed files with 1 additions and 1 deletions
  1. 1 1
      toolset/databases/mongodb/create.js

+ 1 - 1
toolset/databases/mongodb/create.js

@@ -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})