How to use the BSONPure function from bson

Find comprehensive JavaScript bson.BSONPure code examples handpicked from public code repositorys.

2
3
4
5
6
7
8
9
10
11
var fs = Promise.promisifyAll(require('fs'));
var bcrypt = require('bcrypt');
var hash = Promise.promisify(bcrypt.hash);
var compare = Promise.promisify(bcrypt.compare);
var bson = require('bson');
var BSON = bson.BSONPure.BSON;

var app = express();

var PASSWORD_FILE = './password.bson';
fork icon15
star icon28
watch icon4

+ 3 other calls in file

233
234
235
236
237
238
239
240
241
242

```js
var flat = require('node-flat-db')
var storage: storage = require('node-flat-db/file-sync')
var bson = require('bson')
var BSON = new bson.BSONPure.BSON()

flat('db.bson', { storage, format: {
  serialize: BSON.serialize,
  deserialize: BSON.deserialize
fork icon3
star icon4
watch icon2

+ 3 other calls in file

133
134
135
136
137
138
139
140
141
142
db.collection('slices', function(err, collection) {
  if (err) {
    db.close();
    return callback(err);
  }
    var BSON = bson.BSONPure;
  collection.remove({user: user, _id: new BSON.ObjectID(id)}, function(err, num) {
    db.close();
    return callback(err, num);
  });
fork icon0
star icon1
watch icon2