MCPcopy
hub / github.com/mongodb/node-mongodb-native / createChunkDoc

Function createChunkDoc

src/gridfs/upload.ts:230–237  ·  view source on GitHub ↗
(filesId: ObjectId, n: number, data: Uint8Array)

Source from the content-addressed store, hash-verified

228}
229
230function createChunkDoc(filesId: ObjectId, n: number, data: Uint8Array): GridFSChunk {
231 return {
232 _id: new ObjectId(),
233 files_id: filesId,
234 n,
235 data
236 };
237}
238
239async function checkChunksIndex(stream: GridFSBucketWriteStream): Promise<void> {
240 const index = { files_id: 1, n: 1 };

Callers 2

doWriteFunction · 0.85
writeRemnantFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected