How to use the BSONNative function from bson

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

0
1
2
3
4
5
6
7
8
9
'use strict';

var assert = require('assert');
var bitcore = require('bitcore-lib');
var bson = require('bson');
var BSON = new bson.BSONNative.BSON();

var utils = require('../utils');

/**
fork icon32
star icon35
watch icon17

6
7
8
9
10
11
12
13
var data = BSON.serialize(doc, false, true, false);
console.log("data:", data);
// Deserialize the resulting Buffer
var doc_2 = BSON.deserialize(data);
console.log("doc_2:", doc_2);
BSON = new bson.BSONNative.BSON();
data = BSON.serialize(doc);
doc_2 = BSON.deserialize(data);
fork icon0
star icon0
watch icon0