How to use the deserializeStream function from bson

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

190
191
192
193
194
195
196
197
198
199
    let docSizeEnd = docSizeBufEnd.readInt32LE(0)
    let rangeSize = docPositionEnd-docPosition+docSizeEnd
    let docBuf = Buffer.alloc(rangeSize)
    let docArr = []
    fs.readSync(blocks.fd,docBuf,{offset: 0, position: docPosition, length: rangeSize})
    BSON.deserializeStream(docBuf,0,end-start+1,docArr,0)
    return docArr
},
fillInMemoryBlocks: (headBlock = blocks.height+1) => {
    assert(blocks.isOpen,blocks.notOpenError)
fork icon64
star icon93
watch icon0

134
135
136
137
138
139
140
141
142
143
this.collectionName = readCString(data);
this.numToSkip = readInt32(data);
this.numToReturn = readInt32(data);
var returnCount = this.numToReturn;
var docs = [];
bson.deserializeStream(data, offset, 1, docs, this.numToSkip);
this.query = docs;
//We're not finished yet, which implies the optional returnFieldsSelector is set.
if(offset < data.length) {
    var fields = [];
fork icon23
star icon83
watch icon0

+ 2 other calls in file