Skip to content

Streaming BSON parser with rudimentary MongoDB archive support

Notifications You must be signed in to change notification settings

kcwiki/stream-bson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stream-bson

Version

Streaming BSON parser with rudimentary MongoDB archive support.

  • bson is used for parsing, it is faster than bson-ext according to some tests.

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 in StreamBSON options will skip the archive header (until \x07_id) and ignore the footer (via parsing error).

About

Streaming BSON parser with rudimentary MongoDB archive support

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published