stream-bson
Streaming BSON parser with rudimentary MongoDB archive support.
Install
$ npm i stream-bson
# or
$ yarn add stream-bson
Usage
const { createReadStream } = require('fs')
const StreamBSON = require('stream-bson')
createReadStream('...')
.pipe(new StreamBSON({ archive: true }))
.on('data', doc => {})
.on('finish', () => {})
.on('error', err => {})
Todo
- Proper exception handling / multistream support.
- MongoDB archives are not parsed properly. Assuming there is a BSON file in the archive, setting
archive
inStreamBSON
options will skip the archive header (until\x07_id
) and ignore the footer (via parsing error).