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

Function createFilesDoc

src/gridfs/upload.ts:388–408  ·  view source on GitHub ↗
(
  _id: ObjectId,
  length: number,
  chunkSize: number,
  filename: string,
  metadata?: Document
)

Source from the content-addressed store, hash-verified

386}
387
388function createFilesDoc(
389 _id: ObjectId,
390 length: number,
391 chunkSize: number,
392 filename: string,
393 metadata?: Document
394): GridFSFile {
395 const ret: GridFSFile = {
396 _id,
397 length,
398 chunkSize,
399 uploadDate: new Date(),
400 filename
401 };
402
403 if (metadata) {
404 ret.metadata = metadata;
405 }
406
407 return ret;
408}
409
410function doWrite(
411 stream: GridFSBucketWriteStream,

Callers 1

checkDoneFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected