morelikethis
v0.1.3
Published
Create more data that has the same shape as existing data.
Downloads
3
Maintainers
Keywords
Readme
morelikethis
Create more data that has the same shape as existing data.
To be used with mongodb-schema to infer a schema from your original data in a MongoDB collection, and mgeneratejs to generate more data.
The morelikethis
script acts as a bridge between the two, converting a
schema to a data generation template.
Example
Install morelikethis, mongodb-schema, and mgeneratejs:
npm install -g morelikethis mongodb-schema mgeneratejs
Make sure you have a MongoDB instance running on localhost, standard port 27017 (or adjust example below accordingly).
Assuming a database products
and a collection catalog
, run:
mongodb-schema localhost:27017 products.catalog | morelikethis | mgeneratejs -n 1000
This would generate 1000 more documents like the ones in the products.catalog
collection and output them to stdout, one per line.
If you have mongoimport installed, you can write them to a
new collection test.mycatalog
right away:
mongodb-schema localhost:27017 products.catalog | morelikethis | mgeneratejs -n 1000 | mongoimport -d test -c mycatalog
License
Apache 2.0