(options: OnDemandDocumentDeserializeOptions)
| 304 | } |
| 305 | |
| 306 | public shift(options: OnDemandDocumentDeserializeOptions): any { |
| 307 | if (this.iterated >= this.batchSize) { |
| 308 | return null; |
| 309 | } |
| 310 | |
| 311 | const result = this.batch.get(this.iterated, BSONType.object, true) ?? null; |
| 312 | const encryptedResult = this.encryptedBatch?.get(this.iterated, BSONType.object, true) ?? null; |
| 313 | |
| 314 | this.iterated += 1; |
| 315 | |
| 316 | if (options?.raw) { |
| 317 | return result.toBytes(); |
| 318 | } else { |
| 319 | const object = result.toObject(options); |
| 320 | if (encryptedResult) { |
| 321 | decorateDecryptionResult(object, encryptedResult.toObject(options), true); |
| 322 | } |
| 323 | return object; |
| 324 | } |
| 325 | } |
| 326 | |
| 327 | public clear() { |
| 328 | this.iterated = this.batchSize; |
no test coverage detected