# mongo-interface

> A mongodb library to interface with nodejs mongo native drivers

Latest version **2.0.0** (published 2017-02-12) · Copyright © Luca Di Vincenzo license · 0 weekly downloads

## Install

```sh
npm install mongo-interface
pnpm add mongo-interface
yarn add mongo-interface
bun add mongo-interface
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2017-02-12 |
| First published | 2015-11-23 |
| Weekly downloads | 0 |
| License | Copyright © Luca Di Vincenzo |
| TypeScript types | none |
| Module format | CommonJS |
| Node | 6.3.1 |
| Dependencies | 6 |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| Author | Luca Di Vincenzo |
| Maintainers | lucadv |

## Links

- npm: https://www.npmjs.com/package/mongo-interface
- npm.io page: https://npm.io/package/mongo-interface

## Dependencies (6)

- [hoek](https://npm.io/package/hoek.md) ^4.1.0
- [async](https://npm.io/package/async.md) ^2.1.4
- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [moment](https://npm.io/package/moment.md) ^2.17.1
- [mongodb](https://npm.io/package/mongodb.md) 2.2.22
- [object-hash](https://npm.io/package/object-hash.md) ^1.1.5

## Recent versions

- 2.0.0 (latest) — 2017-02-12
- 1.1.0 — 2016-02-25
- 1.0.0 — 2015-11-23

## README

## Overview

This is meant to be an interface to mongodb native drivers for nodejs. Connects to mongo and, for each collection that you specify, offer an interface to basic mongo operations. 

## Install

npm install mongo-interface

## Usage

```
var Mongo = require('mongo-interface');

var options = {
  uri: 'mongodb://localhost:27017/test',
  collections: [ 'test' ]
};

Mongo.create(options, function (err, collections) {
  collections.test.find({}, function (err, docs) {
    // in docs all documents of collection test
  });
});
```

## Supported operations

Supported operations are:

  * find (query, callback) - callback with an array of docs
  * findOne (query, callback)
  * findOneAndUpdate (filter, update, options, callback)
  * updateOne (filter, update, options, callback)
  * updateMany (filter, update, options, callback)
  * insert (document, callback)
  * insertMany (docs, callback)
  * remove (query, callback)

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