# mongodb-balancer

> An nodejs library that allows to do actions with multiple instances of mongodb.

Latest version **1.2.3** (published 2020-10-14) · ISC license · 0 weekly downloads

## Install

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

## 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 | 1.2.3 |
| Published | 2020-10-14 |
| First published | 2020-06-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | miceve |

## Links

- npm: https://www.npmjs.com/package/mongodb-balancer
- npm.io page: https://npm.io/package/mongodb-balancer

## Dependencies (1)

- [mongodb](https://npm.io/package/mongodb.md) ^3.5.9

## Recent versions

- 1.2.3 (latest) — 2020-10-14
- 1.1.4 — 2020-07-07
- 1.1.3 — 2020-07-07
- 1.1.2 — 2020-07-07
- 1.1.1 — 2020-07-07
- 1.1.0 — 2020-07-01
- 1.0.9 — 2020-06-23
- 1.0.8 — 2020-06-23
- 1.0.6 — 2020-06-22
- 1.0.5 — 2020-06-22
- 1.0.4 — 2020-06-22
- 1.0.3 — 2020-06-22
- 1.0.2 — 2020-06-22
- 1.0.1 — 2020-06-22
- 1.0.0 — 2020-06-22

## README

# **MongoDB balancer library**
This library allows you to operate data in many mongodb hosts as in one.
## THIS LIBRARY DON'T SYNCING DATA BETWEEN HOSTS!
Instead of this, mongodb-balancer operating many clusters as chunks of one cluster.
E.g when you do "insert" command, library is selection least loaded cluster, and inserts data in this cluster.

That can help you to split your data into many servers, instead of buying good server with hard disk, full of terabytes of data.
### How to use it!?
You can use it as native mongodb library!
But here's some changes you need to remember:
- For connecting to multiple hosts you need to use ``mongodb.connectMultiple`` instead of ``mongodb.connect``.
As first argument it takes array of mongodb uris, as second - mongodb connection options (like in native driver).
- ``collection.find`` function not returns ``mongodb.Cursor`` object, instead of that it returns processed array of results (like as after ``Cursor.toArray()`` in native node driver).

#### Enjoy your hundreds of hosts!..

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