{"_id":"node-mongoose-fixtures","_rev":"30-9108b163c4d191ce3dd33b408b435080","name":"node-mongoose-fixtures","time":{"modified":"2022-06-21T17:06:15.273Z","created":"2014-03-14T21:03:30.966Z","0.0.1":"2014-03-14T21:03:30.966Z","0.1.1":"2014-03-18T15:02:56.938Z","0.1.0":"2014-03-18T15:15:21.712Z","0.1.2":"2014-03-18T15:16:14.974Z","0.2.0":"2014-03-20T16:32:02.083Z","0.2.1":"2014-08-10T20:03:29.471Z","0.2.2":"2014-08-10T20:28:19.628Z","0.2.3":"2015-01-09T03:00:14.793Z","0.2.4":"2015-03-23T23:56:35.198Z","0.3.0":"2018-06-07T16:58:21.662Z"},"description":"Easy way to create mongoose fixtures.","readme":"node-mongoose-fixtures\n======================\n\n[![Build Status](https://travis-ci.org/kennethklee/node-mongoose-fixtures.svg?branch=master)](https://travis-ci.org/kennethklee/node-mongoose-fixtures)\n[![Code Climate](https://codeclimate.com/github/kennethklee/node-mongoose-fixtures.png)](https://codeclimate.com/github/kennethklee/node-mongoose-fixtures)\n\nCreate mongoose fixtures from a dataset.\n\nThis will iteratively insert records through mongoose.\n\ninstall\n-------\n\n`npm install node-mongoose-fixtures`\n\nusage\n-----\n\n```javascript\nvar fixtures = require('node-mongoose-fixtures');\n\nfixtures({\n    <table name>: [\n        <record>,\n        <record>\n    ],\n    <table name>: [\n        <record>,\n        <record>\n    ]\n});\n\n\n```\n\nexamples\n--------\n\n```javascript\nvar mongoose = require('mongoose'),\n    Schema = mongoose.Schema,\n    fixtures = require('node-mongoose-fixtures');\n\n// User\nvar userSchema = new Schema({\n    username: String,\n    password: String\n});\nmongoose.model('users', userSchema);\n\n// Book\nvar bookSchema = new Schema({\n    title: String\n});\nmongoose.model('books', bookSchema);\n\n\n// Create dataset immediately\nfixtures({\n    users: [\n        {username: 'one', password: 'pass'},\n        {username: 'two', password: 'pass'}\n    ],\n    books: [\n        {title: 'Enders Game'},\n        {title: 'Speaker of the Dead'}\n    ]\n}, function(err, data) {\n    // data is an array of all the documents created\n});\n\n// Name a dataset for future use\nfixtures.save('users', {\n    users: [\n        {username: 'one', password: 'pass'},\n        {username: 'two', password: 'pass'}\n    ]\n});\n\n// Use the named dataset\nfixtures('users', function(err, data) {\n    // Again, data is an array of all documents created\n});\n```\n\napi\n---\n\n### Create Dataset\n\n`fixtures(dataset, <mongoose instance>, <callback>);`\n\nImmediately creates the documents from the dataset through the mongoose connection.\n\n* `dataset` can be a hash or a name of a named fixture.\n* `mongoose instance` is optional and is a singular instance of mongoose.\n* `callback` is an optional function when the action is complete. It's parameters are callback(error, data documents). Both arguments are arrays. The data documents are mongoose documents from the fixture data.\n\n\n### Save a Named Fixture\n\n`fixtures.save(name, dataset, <callback>);`\n\nSave a fixture to be used for later.\n\n* `name` is the name of your new named fixture.\n* `dataset` is the hash of the dataset you want to save.\n* `callback` is an optional function when the action is complete. It's parameters are callback(err, old fixtures). The old fixtures are what you've overwritten.\n\n\n### Retrieve a Named Fixture's Dataset\n\n`fixtures.get(name, <callback>);`\n\nRetrieves a named fixture's dataset. If callback is omitted, this will simply return the named fixture's dataset.\n\n* `name` is the name of the named fixture you wish to retrieve.\n* `callback` is an optional function when the action is complete. It's parameters are callback(err, dataset).\n\n\n### Clear Named Fixture\n\n`fixtures.clear(<name>, <callback>);`\n\nClears named fixtures.\n\n* `name` is optional. It's the name of the named fixture. If omitted, all named fixtures will be cleared.\n* `callback` is an optional function when the action is complete. It has no parameters.\n\n\n### Reset Database Collection(s)\n\n`fixtures.reset(<model name>, <mongoose instance>, <callback>);`\n\nDeletes all documents within a collection.\n\n* `model name` is optional. It's the name of the collection. If omitted, all collections will be purged.\n* `mongoose instance` is optional and is a singular instance of mongoose.\n* `callback` is an optional function when the action is complete. It's parameters are the same as the callback from `mongoose.Model.remove()`\n\n\nsupport\n-------\n\nDonations are welcome to help support the continuous development of this project.\n\n[![Flattr][flattr-image]][flattr-url]\n[![Bitcoin][bitcoin-image]][bitcoin-url]\n\n\n[flattr-url]: https://flattr.com/submit/auto?user_id=kennethkl&url=https://github.com/kennethklee/node-mongoose-fixtures&title=node-mongoose-fixtures&language=&tags=github&category=software\n[flattr-image]: http://img.shields.io/badge/flattr-donate-green.svg?style=flat-square\n\n[bitcoin-image]: http://img.shields.io/badge/bitcoin-1L9EhwhiSTPtEoXeGDBABRXmEJwovwkWpk-green.svg?style=flat-square\n[bitcoin-url]: https://www.coinbase.com/checkouts/5653371de64aa773f372a1e33c569095?name=node-mongoose-fixtures","maintainers":[{"name":"kennethkl","email":"kennethkl@gmail.com"}],"dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"node-mongoose-fixtures","version":"0.1.0","description":"Easy way to create mongoose fixtures.","main":"index.js","scripts":{"test":"mocha -R spec"},"repository":{"type":"git","url":"git://github.com/kennethklee/node-mongoose-fixtures.git"},"keywords":["mongoose","text","fixtures"],"author":{"name":"Kenneth Lee","email":"kennethkl@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kennethklee/node-mongoose-fixtures/issues"},"homepage":"https://github.com/kennethklee/node-mongoose-fixtures","files":["index.js","lib"],"dependencies":{"async":"~0.2.10"},"devDependencies":{"mongoose":"~3.8.8","mockgoose":"~1.7.7","mocha":"~1.18.0"},"_id":"node-mongoose-fixtures@0.1.0","dist":{"shasum":"86f680e838701bc314e9174d3ff466e057a74de1","tarball":"https://registry.npmjs.org/node-mongoose-fixtures/-/node-mongoose-fixtures-0.1.0.tgz","integrity":"sha512-M0uXnu/uHom+P0UwjQp2jjs9mPVuU5PTwq93aMwGzSdEM6fB5KVuHNjHY7w9XPaJj4+OfcreLmK1mXp/cKa2dQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCgW1T1stQtN+qFXZPl8lG7g6TCle2NyTyWtUmD+jpwDAIgHz3QV8UrevxSsrRuUZ/H+Sz10hXYPW6Pd0uJM8yFRro="}]},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"kennethkl","email":"kennethkl@gmail.com"},"maintainers":[{"name":"kennethkl","email":"kennethkl@gmail.com"}],"directories":{}},"0.1.2":{"name":"node-mongoose-fixtures","version":"0.1.2","description":"Easy way to create mongoose fixtures.","main":"index.js","scripts":{"test":"mocha -R spec"},"repository":{"type":"git","url":"git://github.com/kennethklee/node-mongoose-fixtures.git"},"keywords":["mongoose","test","fixtures"],"author":{"name":"Kenneth Lee","email":"kennethkl@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kennethklee/node-mongoose-fixtures/issues"},"homepage":"https://github.com/kennethklee/node-mongoose-fixtures","files":["index.js","lib"],"dependencies":{"async":"~0.2.10"},"devDependencies":{"mongoose":"~3.8.8","mockgoose":"~1.7.7","mocha":"~1.18.0"},"_id":"node-mongoose-fixtures@0.1.2","dist":{"shasum":"3952c87ddf86556c03501745e80db32ffdf0c272","tarball":"https://registry.npmjs.org/node-mongoose-fixtures/-/node-mongoose-fixtures-0.1.2.tgz","integrity":"sha512-fMI6Wa9Z1lJXiAIYeRQ0WMSD5O2KaIQY+tMLQ2B73YIzHSgElTOHGCMu7gxqD5YA2L2S5PIt+JdKCNmLpU3Avg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCTiXCu1sAZrwB7hRAElARlajhEJWOhf9vzZljDdSnd6AIgb+KkkzoD6UdWjX256WInkeyKg0dzEL40ozktQA/wUi8="}]},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"kennethkl","email":"kennethkl@gmail.com"},"maintainers":[{"name":"kennethkl","email":"kennethkl@gmail.com"}],"directories":{}},"0.2.0":{"name":"node-mongoose-fixtures","version":"0.2.0","description":"Easy way to create mongoose fixtures.","main":"index.js","scripts":{"test":"mocha -R spec"},"repository":{"type":"git","url":"git://github.com/kennethklee/node-mongoose-fixtures.git"},"keywords":["mongoose","test","fixtures"],"author":{"name":"Kenneth Lee","email":"kennethkl@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kennethklee/node-mongoose-fixtures/issues"},"homepage":"https://github.com/kennethklee/node-mongoose-fixtures","files":["index.js","lib"],"dependencies":{"async":"~0.2.10"},"devDependencies":{"mongoose":"~3.8.8","mockgoose":"~1.7.7","mocha":"~1.18.0"},"_id":"node-mongoose-fixtures@0.2.0","dist":{"shasum":"e4982d96df9408203d794623959fb00d2d3eac1d","tarball":"https://registry.npmjs.org/node-mongoose-fixtures/-/node-mongoose-fixtures-0.2.0.tgz","integrity":"sha512-nX+w4BvaJXDlYaLqISCAsLZvFVSA/ycsYEIyTvHLYhz+t3WHwkfBXRqE4wqpi7u9w7482TsahPnNJjLHAMJc4g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFtfUhNMi9t7/EHOoSzadHiCU69vu07lc1VTGlVmx9oMAiEA18W3yDeb18VDVYADFZxCqoGMDNEDkY0PTez80hDYPVE="}]},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"kennethkl","email":"kennethkl@gmail.com"},"maintainers":[{"name":"kennethkl","email":"kennethkl@gmail.com"}],"directories":{}},"0.2.1":{"name":"node-mongoose-fixtures","version":"0.2.1","description":"Easy way to create mongoose fixtures.","main":"index.js","scripts":{"pretest":"jshint *.js lib","test":"mocha -R spec"},"repository":{"type":"git","url":"git://github.com/kennethklee/node-mongoose-fixtures.git"},"keywords":["mongoose","test","fixtures"],"author":{"name":"Kenneth Lee","email":"kennethkl@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kennethklee/node-mongoose-fixtures/issues"},"homepage":"https://github.com/kennethklee/node-mongoose-fixtures","files":["index.js","lib"],"dependencies":{"async":"~0.2.10"},"devDependencies":{"mongoose":"~3.8.8","mockgoose":"~1.7.7","mocha":"~1.18.0","jshint":"~2.5.0"},"gitHead":"f0f382cab55e68744f814ea93f32e11665270ce4","_id":"node-mongoose-fixtures@0.2.1","_shasum":"fec72f21550fbb99735ca12bb06cab3e8039cd6e","_from":".","_npmVersion":"2.0.0-alpha-5","_npmUser":{"name":"kennethkl","email":"kennethkl@gmail.com"},"maintainers":[{"name":"kennethkl","email":"kennethkl@gmail.com"}],"dist":{"shasum":"fec72f21550fbb99735ca12bb06cab3e8039cd6e","tarball":"https://registry.npmjs.org/node-mongoose-fixtures/-/node-mongoose-fixtures-0.2.1.tgz","integrity":"sha512-7aTMKTRGLJ+LWSFm27KHQMx1jBo+pQNPQM4HCcGYZNiuHWa0B6byKH741lpAWOvkM2W+T0OzyZW6zmv7x2eRsA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDipfQW2ioJ/oJKu57qKL2UIzpgDCz2MOgzz/d955/BEQIhAMha0NnZtnpCHiORZ/FKOeoUB9SMF8Xllo+TQnvPHcGz"}]},"directories":{}},"0.2.2":{"name":"node-mongoose-fixtures","version":"0.2.2","description":"Easy way to create mongoose fixtures.","main":"index.js","scripts":{"pretest":"jshint *.js lib","test":"mocha -R spec"},"repository":{"type":"git","url":"git://github.com/kennethklee/node-mongoose-fixtures.git"},"keywords":["mongoose","test","fixtures"],"author":{"name":"Kenneth Lee","email":"kennethkl@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kennethklee/node-mongoose-fixtures/issues"},"homepage":"https://github.com/kennethklee/node-mongoose-fixtures","files":["index.js","lib"],"dependencies":{"async":"~0.2.10"},"devDependencies":{"mongoose":"~3.8.8","mockgoose":"~1.7.7","mocha":"~1.18.0","jshint":"~2.5.0"},"gitHead":"7de9f7bb0cadb975778ef8f04113406e5e0e073f","_id":"node-mongoose-fixtures@0.2.2","_shasum":"87ddc69ba40358057b97fe5e8df1638b6398528e","_from":".","_npmVersion":"2.0.0-alpha-5","_npmUser":{"name":"kennethkl","email":"kennethkl@gmail.com"},"maintainers":[{"name":"kennethkl","email":"kennethkl@gmail.com"}],"dist":{"shasum":"87ddc69ba40358057b97fe5e8df1638b6398528e","tarball":"https://registry.npmjs.org/node-mongoose-fixtures/-/node-mongoose-fixtures-0.2.2.tgz","integrity":"sha512-bqUFV/aQPWrxI8G1wxRaY+3uxTAtYFr7V1P0pdasXXibkd8HYHrdbxy0jgz4pKSBj2oSo0zKSnSO6b6NCpCRSg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/jQBAEm0NQOAQxWIXqoObIidLZNdBx/kgrdOVvRjFRgIhAIHN7c2FN1vatNgzgRD4bsU3bTVNc99kPqfdy0EdUmHi"}]},"directories":{}},"0.2.3":{"name":"node-mongoose-fixtures","version":"0.2.3","description":"Easy way to create mongoose fixtures.","main":"index.js","scripts":{"pretest":"jshint *.js lib","test":"mocha -R spec"},"repository":{"type":"git","url":"git://github.com/kennethklee/node-mongoose-fixtures.git"},"keywords":["mongoose","test","fixtures"],"author":{"name":"Kenneth Lee","email":"kennethkl@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kennethklee/node-mongoose-fixtures/issues"},"homepage":"https://github.com/kennethklee/node-mongoose-fixtures","files":["index.js","lib"],"dependencies":{"async":"~0.2.10"},"devDependencies":{"mongoose":"~3.8.8","mockgoose":"~1.7.7","mocha":"~1.18.0","jshint":"~2.5.0"},"gitHead":"817cb161a51b5c0ed4b2eb84a93b2e2e4d813a57","_id":"node-mongoose-fixtures@0.2.3","_shasum":"db337b316535e2a10465d86da8e71b7e044b935a","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"kennethkl","email":"kennethkl@gmail.com"},"maintainers":[{"name":"kennethkl","email":"kennethkl@gmail.com"}],"dist":{"shasum":"db337b316535e2a10465d86da8e71b7e044b935a","tarball":"https://registry.npmjs.org/node-mongoose-fixtures/-/node-mongoose-fixtures-0.2.3.tgz","integrity":"sha512-Y40U2cbOg2pJSquynLuzNh9hPCAgXUdNxfZav5IsJF2VTWgHxmLQnCssuBZHPPCjdWNwjty3UyDIyY6ASFTsXw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHbACmuKxiV4d1OgLQf2fJ38Igi83wBnbds8HAzezb0DAiAVRgKOsIODLeeIjs4a6t+pqWKqnt1WzuANCOvyMGUDRA=="}]},"directories":{}},"0.2.4":{"name":"node-mongoose-fixtures","version":"0.2.4","description":"Easy way to create mongoose fixtures.","main":"index.js","scripts":{"pretest":"jshint *.js lib","test":"mocha -R spec"},"repository":{"type":"git","url":"git://github.com/kennethklee/node-mongoose-fixtures.git"},"keywords":["mongoose","test","fixtures"],"author":{"name":"Kenneth Lee","email":"kennethkl@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kennethklee/node-mongoose-fixtures/issues"},"homepage":"https://github.com/kennethklee/node-mongoose-fixtures","files":["index.js","lib"],"dependencies":{"async":"~0.2.10"},"devDependencies":{"mongoose":"~3.8.8","mockgoose":"~1.7.7","mocha":"~1.18.0","jshint":"~2.5.0"},"gitHead":"bb0a8eca769ceaae9ffd0d720598486b52a5e3ac","_id":"node-mongoose-fixtures@0.2.4","_shasum":"478c298e3d450f2269d2565d72477a9b324dbfa7","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"kennethkl","email":"kennethkl@gmail.com"},"maintainers":[{"name":"kennethkl","email":"kennethkl@gmail.com"}],"dist":{"shasum":"478c298e3d450f2269d2565d72477a9b324dbfa7","tarball":"https://registry.npmjs.org/node-mongoose-fixtures/-/node-mongoose-fixtures-0.2.4.tgz","integrity":"sha512-Sy8H+hp8y7ox1WVSOaOaWc5EExFhxFkPG2CKvSsbQA8FgHcU5hOBCHm0vtbeAhc9mBEk5dym3hf0BuF9F8kf7w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICM5UdIZSRShTCBpeGRoDywQKOntriBoq99g9TnbAw6YAiEA9Mz0SJeb+Q/Zbqbh6dFBSyWXzf4H47VJworm+yXLaEU="}]},"directories":{}},"0.3.0":{"name":"node-mongoose-fixtures","version":"0.3.0","description":"Easy way to create mongoose fixtures.","main":"index.js","scripts":{"pretest":"jshint *.js lib","test":"mocha -R spec"},"repository":{"type":"git","url":"git://github.com/kennethklee/node-mongoose-fixtures.git"},"keywords":["mongoose","test","fixtures"],"author":{"name":"Kenneth Lee","email":"kennethkl@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kennethklee/node-mongoose-fixtures/issues"},"homepage":"https://github.com/kennethklee/node-mongoose-fixtures","files":["index.js","lib"],"dependencies":{"async":"~0.2.10"},"devDependencies":{"mongoose":"~3.8.8","mockgoose":"~1.7.7","mocha":"~1.18.0","jshint":"~2.5.0"},"gitHead":"d6d8feb9912d144a0cd9b4bb6033cf0f28ac94b2","_id":"node-mongoose-fixtures@0.3.0","_npmVersion":"6.1.0","_nodeVersion":"10.4.0","_npmUser":{"name":"kennethkl","email":"kennethkl@gmail.com"},"dist":{"integrity":"sha512-mmFZ28CMmbTqvh5qJckWu/ZC513PRF2rPWCR+YWaiHESdbkVnxfiyrtNDN2eJhH1rAIitCoxCGi6uJzXbb8hpQ==","shasum":"f05be00b8ebc4ed8ff8ec7a0dabd546a44b2305e","tarball":"https://registry.npmjs.org/node-mongoose-fixtures/-/node-mongoose-fixtures-0.3.0.tgz","fileCount":5,"unpackedSize":9105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbGWQuCRA9TVsSAnZWagAADlkP/RV5eNaxxU3xrXrPBKGa\nuIELxMBJjc1oKEA9ZDrsCsSsXS5PdsfLiieABzzpa4iPmj9xgUwwAIwoi/Ln\nhK5FWAHbwfbosu+kZaeibyK6Emk+0jPMhi8DqGzW1hc66Q3/MvOqk9eZMuog\n9EsenYB+G2PKaQaZ79bGmd93oSldiTklkeKRnfpxq6/wGnRGSk0yaX5NaySi\nYLs60nbwJ3WBZOkA2mRW9ZVNrGp4/1Y+KppNA69+UGWVEgXtgl48jp8Zwt7k\nfIUpjXIvK9xg6N3kmB6X9PGk8Xw1p3eN7cF385HqRQVWdkWaBOb47Vc8p8o+\nmAHOYPWT7i9bspai4RHRci5DhZY0S0dbRH17kFHwBIemjrj5XSGs+cKBAAgb\nj1JI6gFP2bfb7RQWUPAfOVJ1mP3ufEKruZsqAeZhlgZIUPxsorFJP7karRY6\n0YqkaHh6Eg7JJtTlcPKbibtg5Z0LYfA8hWJEltIalqEqEnm52puqHXSI48iS\nh4leypvkeDjvDierY28Pp+KyQBBf/YbGPzRmZp2NjDTPa3hEnihZOu0OV/c5\nLFN0T+X2dyvU+Nr4kDkKQNaR+TLdxjMOP5ObG8mbOj7nF9QGnDHJ03Nem/Gl\n1Y8rY0HiZx+ZsGt1yVQ980wBBiikfzQKERnUPlCRAobWuB9BG4teg9s4Ucjn\nsKZS\r\n=E8qG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBwIrercspUNLvJqIcljQmPUDkymnV+uxU3MgVACw7AhAiAVRHRQ7xdMm0S/+yTuTjJZcy/1Myyglyw7f2ZWiwFAsw=="}]},"maintainers":[{"name":"kennethkl","email":"kennethkl@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-mongoose-fixtures_0.3.0_1528390701565_0.3213891197178531"},"_hasShrinkwrap":false}},"homepage":"https://github.com/kennethklee/node-mongoose-fixtures","keywords":["mongoose","test","fixtures"],"repository":{"type":"git","url":"git://github.com/kennethklee/node-mongoose-fixtures.git"},"author":{"name":"Kenneth Lee","email":"kennethkl@gmail.com"},"bugs":{"url":"https://github.com/kennethklee/node-mongoose-fixtures/issues"},"license":"MIT","readmeFilename":"README.md","users":{"crimeminister":true,"hoitmort":true,"santihbc":true,"bdentino":true,"neo1":true}}