Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/codepope/shellfaker
A MongoDB shell script and its port to Node.js as part of a blog
https://github.com/codepope/shellfaker
mongo-shell mongodb nodejs
Last synced: about 1 month ago
JSON representation
A MongoDB shell script and its port to Node.js as part of a blog
- Host: GitHub
- URL: https://github.com/codepope/shellfaker
- Owner: codepope
- Created: 2018-12-03T11:36:45.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-11T19:34:47.000Z (over 1 year ago)
- Last Synced: 2023-08-06T01:28:55.813Z (over 1 year ago)
- Topics: mongo-shell, mongodb, nodejs
- Size: 43.9 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# shellfaker and nodefaker
These are examples which got with the blog posting "Boosting JavaScript: From MongoDB's shell to Node.js". Each example is a different iteration of the solution outlined in the article.
* `shellfaker.js` is the starting point, a MongoDB mongo shell script with generates up fake names and inserts them into a collection.
* `nodefaker.basic.js` is the first iteration, wrapping the shell script with sufficient Node.js calls so that it can run from the command line in a similar way.
* `nodefaker.await.js` uses the `await` and `async` features to replicate the shell's timing behavior.
* `nodefaker.promise.js` gets smarter about promises and boosts the scripts performance.
* `nodefaker.bulk.js` skips the whole thing and goes for really fast bulk inserting as a counter example.