Files: 8f4b43a09aab9801bf28987edd59c2e366180327 / 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