5.1.2 • Published 3 years ago

mongo-move v5.1.2

Weekly downloads
1,383
License
UNLICENSED
Repository
-
Last release
3 years ago

Mongo Move CircleCI npm.io node (tag)

Move documents between MongoDB collection. Applying async transforms, optionally.

Install

$ yarn add mongo-move

Usage

import {MongoClient} from 'mongodb';
import {moveDocs} from 'mongo-move';

const db = await MongoClient.connect('mongo-url');

await moveDocs({
  fromCollection: db.collection('coll-a'),
  toCollection: db.collection('coll-b'),
  selector: {userId: 'some-user-id'},
  projection: {name: 0},
  transformerFn: async doc => {
    doc.movedAt = new Date();
    return doc;
  },
  chunkSize: 1000,
});

Publish

$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags

License

MIT © Vlad Holubiev

5.1.2

3 years ago

5.1.1

3 years ago

5.1.0

3 years ago

5.0.1

3 years ago

4.0.0

6 years ago

3.0.0

7 years ago

2.0.0

7 years ago

1.0.0

7 years ago