mongodump-filter

1.0.0 • Public • Published

mongodump-filter

A utility to filter MongoDB BSON files by duration.

build status npm version mit license we're hiring

Background

MongoDB removed the --filter flag from mongodump in version 3.0. We used this to trim very large collections to a smaller recent set of data. (Our old filter expression was something like {_id: {$gte: ObjectId('6-months-ago')}}.) This program is a replacement for that specific use-case, though I'd be more than happy to have folks extend it to do more things.

Install

$ npm install -g mongodump-filter

Usage

To filter your users collection to just records with _ids in the last 30 days:

$ mongodump-filter 30d < users.bson > users.30d.bson

/mongodump-filter/

    Package Sidebar

    Install

    npm i mongodump-filter

    Weekly Downloads

    0

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • goodeggs-admin