mongodump-filter
v1.0.0
Published
filter mongodump BSON files by timestamp
Downloads
5
Readme
mongodump-filter
A utility to filter MongoDB BSON files by duration.
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 _id
s in the last 30 days:
$ mongodump-filter 30d < users.bson > users.30d.bson