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';
15
28
4
+ 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
3
4
2
+ 3 other calls in file
GitHub: billtt/timemachine
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); });
0
1
2
bson.ObjectId is the most popular function in bson (1017 examples)