christkv/node-mongodb-native — Issue #465: Forward and backward compatible way to get a reference to Binary?
Author: justmoon
Created: 2012-01-02 02:54:46+00:00
State: open

To write BinData objects to MongoDB, you need a reference to `node-mongodb-native`'s Binary object. This depends on the BSON parser used (I think?) and I didn't see an obvious way to get a reference.

I used to have:

``` js
var db = new Db(dbname, new Server(host, port, {}), {});
var Binary = db.bson_serializer.Binary;
```

But a user now [reported this as broken](https://github.com/bitcoinjs/node-bitcoin-p2p/issues/57) for newer `node-mongodb-native` versions.

What's the stable, recommended way to get a reference to the Binary class?