Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Extremely Popular
Latest
method GridFSBucket.prototype.uploadFromStreamWithId
import { GridFSBucket } from "https://deno.land/x/mongo@v0.33.0/src/gridfs/bucket.ts";

Uploads a user file to a GridFS bucket. The application supplies a custom file id.

Reads the contents of the user file from the @source Stream and uploads it as chunks in the chunks collection. After all the chunks have been uploaded, it creates a files collection document for @filename in the files collection.

Note: there is no need to return the id of the uploaded file because the application already supplied it as a parameter.

Parameters

id: FileId
filename: string

Returns

Promise<void>