morelikethis
Create more data that has the same shape as existing data.
Last updated 2 years ago by rueckstiess .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install morelikethis 
SYNC missed versions from official npm registry.

morelikethis travis npm

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

Current Tags

  • 0.1.3                                ...           latest (2 years ago)

4 Versions

  • 0.1.3                                ...           2 years ago
  • 0.1.2                                ...           3 years ago
  • 0.1.1                                ...           4 years ago
  • 0.1.0                                ...           4 years ago

Copyright 2014 - 2017 © taobao.org |