# mongoose-load-fixtures

> Another fixtures loader for mongoose.

Latest version **0.1.3** (published 2014-12-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install mongoose-load-fixtures
pnpm add mongoose-load-fixtures
yarn add mongoose-load-fixtures
bun add mongoose-load-fixtures
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2014-12-17 |
| First published | 2014-10-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+16 in 2 direct dependencies) |
| Install scripts | no |
| Author | BARBIER Jean-Matthieu |
| Maintainers | jmbarbier |
| Keywords | mongoose, fixtures, loader, mongodb |

## Links

- npm: https://www.npmjs.com/package/mongoose-load-fixtures
- Repository: https://github.com/jmbarbier/mongoose-load-fixtures
- Issues: https://github.com/jmbarbier/mongoose-load-fixtures/issues
- npm.io page: https://npm.io/package/mongoose-load-fixtures

## Dependencies (4)

- [async](https://npm.io/package/async.md) ^0.9.0
- [lodash](https://npm.io/package/lodash.md) ^2.4.1
- [mongoose](https://npm.io/package/mongoose.md) ^3.8.18
- [coffee-script](https://npm.io/package/coffee-script.md) ^1.8.0

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [@temporal-architect/claude-plugin](https://npm.io/package/@temporal-architect/claude-plugin.md) — 335 weekly downloads

## Recent versions

- 0.1.3 (latest) — 2014-12-17
- 0.1.2 — 2014-12-15
- 0.1.1 — 2014-12-15
- 0.0.1 — 2014-10-29

## README

Mongoose fixtures loader
========================

[![Build Status](https://travis-ci.org/solidev/mongoose-load-fixtures.svg?branch=master)](https://travis-ci.org/solidev/mongoose-load-fixtures)
[![Dependency Status](https://gemnasium.com/solidev/mongoose-load-fixtures.svg)](https://gemnasium.com/solidev/mongoose-load-fixtures)


This fixture loader is a rewrite of from https://github.com/powmedia/mongoose-fixtures
to pass inserted items to callback, be a bit more flexible about fixtures input formats,
and use dropCollection OR emptyCollection as an option.

Syntax : `loadFixtures(fixturesObject, opts, cb)`

fixturesObject is an object `{ModelName: fixtures, ModelName: fixtures, ...}`

For each model, fixtures can be :

- an array of objects [ {item1: {item1 data},
  item2: {item2 data}}, {item9: {item9 data}}]
  or strings (path to a file which is imported, exported values have to
  be an object)
- an object {item1: {item1 data}, item2: {item2 data}}
- a string (path to a file which is imported, exported values have to be
  an object)

opts can be:

- db : mongoose connection to use
- perCollectionLimit : max concurrent collections to process
- perDocumentLimit : max concurrent document (PER COLLECTION) to process

TODO: if cb is null, a promise should be returned
TODO: add options to drop / empty / keep collection
TODO: check indexes

---
_Source: https://npm.io/package/mongoose-load-fixtures · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
