mongodb-driver v0.6.0 Mongo.GridFs.UploadStream View Source
This is the upload stream for save streams into the grid fs.
First you need to create a bucket. The bucket contains the configuration for the grid fs.
Example:
streaming the file ./test/data/test.jpg
into the grid fs using the upload-stream
bucket = Bucket.new( pid )
upload_stream = Upload.open_upload_stream(bucket, "test.jpg", j: true)
src_filename = "./test/data/test.jpg"
File.stream!(src_filename, [], 512) |> Stream.into(upload_stream) |> Stream.run()
Link to this section Summary
Functions
Creates a new upload stream to insert a file into the grid-fs.
Link to this section Types
Link to this type
t()
View Source
t()
View Source
t() :: %Mongo.GridFs.UploadStream{
bucket: Mongo.GridFs.Bucket.t(),
filename: String.t(),
id: BSON.ObjectId.t(),
metadata: {BSON.document() | nil}
}
t() :: %Mongo.GridFs.UploadStream{ bucket: Mongo.GridFs.Bucket.t(), filename: String.t(), id: BSON.ObjectId.t(), metadata: {BSON.document() | nil} }
Link to this section Functions
Link to this function
new(bucket, filename, metadata \\ nil)
View Source
new(bucket, filename, metadata \\ nil)
View Source
new(Mongo.GridFs.Bucket.t(), String.t(), BSON.document() | nil) ::
Mongo.GridFs.UploadStream.t()
new(Mongo.GridFs.Bucket.t(), String.t(), BSON.document() | nil) :: Mongo.GridFs.UploadStream.t()
Creates a new upload stream to insert a file into the grid-fs.