# mongodb-client

> A nice API client for MongoDB.

Latest version **0.0.1** (published 2017-01-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install mongodb-client
pnpm add mongodb-client
yarn add mongodb-client
bun add mongodb-client
```

## 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.0.1 |
| Published | 2017-01-26 |
| First published | 2016-02-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4.3.1 |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 6 |
| Author | fengmk2 |
| Maintainers | fengmk2 |
| Keywords | mongodb-client, mongodb, mongo |

## Links

- npm: https://www.npmjs.com/package/mongodb-client
- Repository: https://github.com/node-modules/mongodb-client
- Issues: https://github.com/node-modules/mongodb-client/issues
- npm.io page: https://npm.io/package/mongodb-client

## Dependencies (4)

- [depd](https://npm.io/package/depd.md) ^1.1.0
- [debug](https://npm.io/package/debug.md) ^2.6.0
- [mongodb](https://npm.io/package/mongodb.md) ^2.2.22
- [sdk-base](https://npm.io/package/sdk-base.md) ^3.0.1

## 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.0.1 (latest) — 2017-01-26
- 0.0.0 — 2016-02-24

## README

mongodb-client
=======

[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][codecov-image]][codecov-url]
[![David deps][david-image]][david-url]
[![npm download][download-image]][download-url]

[npm-image]: https://img.shields.io/npm/v/mongodb-client.svg?style=flat-square
[npm-url]: https://npmjs.org/package/mongodb-client
[travis-image]: https://img.shields.io/travis/node-modules/mongodb-client.svg?style=flat-square
[travis-url]: https://travis-ci.org/node-modules/mongodb-client
[codecov-image]: https://codecov.io/github/node-modules/mongodb-client/coverage.svg?branch=master
[codecov-url]: https://codecov.io/github/node-modules/mongodb-client?branch=master
[david-image]: https://img.shields.io/david/node-modules/mongodb-client.svg?style=flat-square
[david-url]: https://david-dm.org/node-modules/mongodb-client
[download-image]: https://img.shields.io/npm/dm/mongodb-client.svg?style=flat-square
[download-url]: https://npmjs.org/package/mongodb-client

A nice API client for MongoDB.

## Features

- Make API as same as [MongoDB CRUD Reference](https://docs.mongodb.org/manual/reference/crud/)
- Reading the source codes just like reading the document of MongoDB client.
- Fix native mongodb `insertedIds` data format error on `options.ordered = false`.
- Remove `insert()` method, please use the more clear `insertMany()` and `insertOne()` instead.
- Disable `options.forceServerObjectId` on write methods.
- ...

## Installation

```bash
$ npm install mongodb-client
```

## Quick start

```js
const co = require('co');
const MongoDB = require('mongodb-client');

const db = new MongoDB('mongodb://localhost:27017/myproject');
// listen db connect error event
db.on('error', err => {
  console.error(err);
});
// wait for db connected
db.ready(() => {
  // let's read and write
  co(function*() {
    const result = yield db.collection('user').insertMany([
      { name: 'fengmk2', type: 'JavaScript' },
      { name: 'dead-horse', type: 'JavaScript' },
      { name: 'tj', type: 'go' },
    ]);
    console.log(result);

    const docs = yield db.collection('user').find({ type: 'JavaScript' }).skip(10).toArray();
    console.log(docs);
  }).catch(err => {
    console.error(err);
    console.error(err.stack);
  });
});
```

## License

[MIT](LICENSE)

---

# APIs

## CURD

### Insert Documents

TBD

### Modify Documents

TBD

### Query Documents

TBD

### Remove Documents

## Indexes

TBD

## Aggregation

TBD

## Administration

TBD

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