bulk-mongodb
bulk-mongodb is a utility to assist integration testing, it simply bulk inserts documents into collections, and allows you to drop them.
Install
$ npm install bulk-mongodb --save-dev
Setup
Consider the following test, the before
block, setups a data set with an array of things to import. We create a BulkMongoDb
, passing in a mongodb url
, and the data set. we then execute bulkMongoDb.insert
, which runs the bulk insert. The after
block cleans this up by dropping the collections we added.
'use strict'; var assert = ;var BulkMongoDb = ; ;
Fixtures
The fixture used in the above example.
Test
$ npm test
License
This work is licensed under the MIT License (see the LICENSE file).
https://github.com/AndrewKeig/bulk-mongodb/blob/master/LICENSE