Skip to content

Instantly share code, notes, and snippets.

@dincosman
Created May 14, 2024 09:54
Show Gist options
  • Select an option

  • Save dincosman/d27729b29d28fc618b16965d01d31ded to your computer and use it in GitHub Desktop.

Select an option

Save dincosman/d27729b29d28fc618b16965d01d31ded to your computer and use it in GitHub Desktop.
Insert 1000000 rows on MongoDB
osmandinc@192 mongoapi % node 1mri_mongo.js
(node:23091) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Inserted: 1000000 rows
Operation took: 21868.841958 milliseconds
[root@mongo01 ~]# mongosh mongodb://insanedba:[email protected]:27001/test
Current Mongosh Log ID: 663681a98dee05e7f72202d7
Connecting to: mongodb://<credentials>@192.168.1.31:27001/test?directConnection=true&appName=mongosh+2.2.5
Using MongoDB: 7.0.9
Using Mongosh: 2.2.5
For mongosh info see: https://docs.mongodb.com/mongodb-shell/
test> db.posts.count();
DeprecationWarning: Collection.count() is deprecated. Use countDocuments or estimatedDocumentCount.
1000000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment