mm.. did some experiments with BSON.deserialize and all worked out quite
nice [1]. Not sure why you're getting those errors.
[1] see
https://www.npmjs.com/package/bson-stream
-Tim
Brendan Loudermilk schreef op 17-01-15 om 02:38:
> if(size <5||size >buffer.length)thrownewError("corrupt bson message")
> ^
> Error: corrupt bson message
> at Function.BSON.deserialize
> (/Users/bloudermilk/Projects/talkchain-archiver/node_modules/bson/lib/bson/bson.js:1221:46)
> at Function.BSON.deserializeStream
> (/Users/bloudermilk/Projects/talkchain-archiver/node_modules/bson/lib/bson/bson.js:1107:41)
> at Object.<anonymous>
> (/Users/bloudermilk/Projects/talkchain-archiver/read.js:9:6)
> at Module._compile (module.js:456:26)
> at Object.Module._extensions..js (module.js:474:10)
> at Module.load (module.js:356:32)
> at Function.Module._load (module.js:312:12)
> at Function.Module.runMain (module.js:497:10)
> at startup (node.js:119:16)
> at node.js:929:3
> |
>
> I guess my first question is, is this a sane way of archiving MongoDB
> data as BSON? If so, any idea why the seemingly simple code above isn't
> working? If not, any recommended solutions?
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google
> Groups "node-mongodb-native" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
node-mongodb-na...@googlegroups.com
> <mailto:
node-mongodb-na...@googlegroups.com>.
> For more options, visit
https://groups.google.com/d/optout.