# mongo-delta

> Delta Update data between different mongodb

Latest version **1.0.0** (published 2016-07-12) · MIT license · 0 weekly downloads

## Install

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

## 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.0.0 |
| Published | 2016-07-12 |
| First published | 2016-07-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+10 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | lcz |
| Maintainers | cangzhen |
| Keywords | mongodb, transition, delta, incremental, synchronouse, update |

## Links

- npm: https://www.npmjs.com/package/mongo-delta
- Repository: https://github.com/cangzhen/mongo-delta
- Homepage: https://github.com/cangzhen/mongo-delta#readme
- Issues: https://github.com/cangzhen/mongo-delta/issues
- npm.io page: https://npm.io/package/mongo-delta

## Dependencies (4)

- [async](https://npm.io/package/async.md) ~1.5.0
- [lodash](https://npm.io/package/lodash.md) ~4.x
- [moment](https://npm.io/package/moment.md) ~2.10.6
- [mongoose](https://npm.io/package/mongoose.md) ~4.x

## 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
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-07-12

## README

[![Build Status](https://api.travis-ci.org/cangzhen/mongo-delta.svg?branch=master)](https://travis-ci.org/cangzhen/mongo-delta)
[![NPM version](https://badge.fury.io/js/mongoose.svg)](http://badge.fury.io/js/mongoose)

#`mongo-delta`: Delta Update data between two mongodb


`mongo-delta` 增量同步两个mongodb的数据


##Installing

```
npm install mongo-delta
```

##Usage

```javascript
   var A =  'mongodb://localhost:27017/test';
   var B = 'mongodb://localhost:27017/test1';
   var opts = {
        src: A,
        dest: B
   }
    
    //schema definition two transition between two database
    opts.schemes = [
        {name: 'Cat', schema: CatSchema}
    ]
    
    var MongoDelta = require('./mongoDelta');
    var delta = new MongoDelta(opts);
    delta.startOne();
    //delta.startLoop(); //loop 

```

##Opts

- src 源数据库的url
- dest 目标数据库的url
- step 每次比较数据的时间片段长度，单位秒,默认是3600*12
- schemas 定义的schema，是个数组
    - name shema的名称
    - schema shema的定义
    - timeField 时间字段名称，默认是updatedAt
    - uFileds 需要更新的字段，如果不定义，默认是所有字段都更新
    

## License

(The MIT License)

Copyright (c) by Tolga Tezel <tolgatezel11@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

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