Files: 65191f9a9664f013ebe726bb95a1a54b086e1bd5 / test / test-79-npm / bson / bson.js
288 bytesRaw
1 | ; |
2 | |
3 | var bson = require('bson'); |
4 | |
5 | var Long = bson.Long; |
6 | var doc = { long: Long.fromNumber(100) }; |
7 | var BSON = bson.BSON; |
8 | var obj = new (BSON)(); |
9 | var data = obj.serialize(doc, false, true, false); |
10 | var doc2 = obj.deserialize(data); |
11 | |
12 | if (doc2.long === 100) { |
13 | console.log('ok'); |
14 | } |
15 |
Built with git-ssb-web