The bucket name.
The bucket name.
the bucket name
Sets the chunk size in bytes.
Sets the chunk size in bytes. Defaults to 255.
the chunk size in bytes.
Given a id
, delete this stored file's files collection document and associated chunks from a GridFS bucket.
Given a id
, delete this stored file's files collection document and associated chunks from a GridFS bucket.
the client session with which to associate this operation
the ObjectId of the file to be deleted
a Observable with a single element indicating when the operation has completed
2.2
Requires MongoDB 3.6 or greater
Given a id
, delete this stored file's files collection document and associated chunks from a GridFS bucket.
Given a id
, delete this stored file's files collection document and associated chunks from a GridFS bucket.
the client session with which to associate this operation
the ObjectId of the file to be deleted
a Observable with a single element indicating when the operation has completed
2.2
Requires MongoDB 3.6 or greater
Given a id
, delete this stored file's files collection document and associated chunks from a GridFS bucket.
Given a id
, delete this stored file's files collection document and associated chunks from a GridFS bucket.
the ObjectId of the file to be deleted
a Observable with a single element indicating when the operation has completed
Given a id
, delete this stored file's files collection document and associated chunks from a GridFS bucket.
Given a id
, delete this stored file's files collection document and associated chunks from a GridFS bucket.
the ObjectId of the file to be deleted
a Observable with a single element indicating when the operation has completed
Downloads the contents of the stored file specified by filename
and by the revision in options
and writes the
contents to the destination
Stream.
Downloads the contents of the stored file specified by filename
and by the revision in options
and writes the
contents to the destination
Stream.
the client session with which to associate this operation
the name of the file to be downloaded
the destination stream
the download options
a Observable with a single element indicating the file has been downloaded
2.2
Requires MongoDB 3.6 or greater
Downloads the contents of the latest version of the stored file specified by filename
and writes the contents to
the destination
Stream.
Downloads the contents of the latest version of the stored file specified by filename
and writes the contents to
the destination
Stream.
the client session with which to associate this operation
the name of the file to be downloaded
the destination stream
a Observable with a single element indicating the file has been downloaded
2.2
Requires MongoDB 3.6 or greater
Downloads the contents of the stored file specified by id
and writes the contents to the destination
AsyncOutputStream.
Downloads the contents of the stored file specified by id
and writes the contents to the destination
AsyncOutputStream.
the client session with which to associate this operation
the custom id of the file, to be written to the destination stream
the destination stream
a Observable with a single element indicating the file has been downloaded
2.2
Requires MongoDB 3.6 or greater
Downloads the contents of the stored file specified by id
and writes the contents to the destination
AsyncOutputStream.
Downloads the contents of the stored file specified by id
and writes the contents to the destination
AsyncOutputStream.
the client session with which to associate this operation
the ObjectId of the file to be written to the destination stream
the destination stream
a Observable with a single element indicating the file has been downloaded
2.2
Requires MongoDB 3.6 or greater
Downloads the contents of the stored file specified by filename
and by the revision in options
and writes the
contents to the destination
Stream.
Downloads the contents of the stored file specified by filename
and by the revision in options
and writes the
contents to the destination
Stream.
the name of the file to be downloaded
the destination stream
the download options
a Observable with a single element indicating the file has been downloaded
Downloads the contents of the latest version of the stored file specified by filename
and writes the contents to
the destination
Stream.
Downloads the contents of the latest version of the stored file specified by filename
and writes the contents to
the destination
Stream.
the name of the file to be downloaded
the destination stream
a Observable with a single element indicating the file has been downloaded
Downloads the contents of the stored file specified by id
and writes the contents to the destination
AsyncOutputStream.
Downloads the contents of the stored file specified by id
and writes the contents to the destination
AsyncOutputStream.
the custom id of the file, to be written to the destination stream
the destination stream
a Observable with a single element indicating the file has been downloaded
Downloads the contents of the stored file specified by id
and writes the contents to the destination
AsyncOutputStream.
Downloads the contents of the stored file specified by id
and writes the contents to the destination
AsyncOutputStream.
the ObjectId of the file to be written to the destination stream
the destination stream
a Observable with a single element indicating the file has been downloaded
Drops the data associated with this bucket from the database.
Drops the data associated with this bucket from the database.
the client session with which to associate this operation
a Observable with a single element indicating when the operation has completed
2.2
Requires MongoDB 3.6 or greater
Drops the data associated with this bucket from the database.
Drops the data associated with this bucket from the database.
a Observable with a single element indicating when the operation has completed
Finds all documents in the collection that match the filter.
Finds all documents in the collection that match the filter.
Below is an example of filtering against the filename and some nested metadata that can also be stored along with the file data:
Filters.and(Filters.eq("filename", "mongodb.png"), Filters.eq("metadata.contentType", "image/png"));
the client session with which to associate this operation
the query filter
the GridFS find iterable interface
2.2
Requires MongoDB 3.6 or greater
com.mongodb.client.model.Filters
Finds all documents in the files collection.
Finds all documents in the files collection.
the client session with which to associate this operation
the GridFS find iterable interface
2.2
Requires MongoDB 3.6 or greater
Finds all documents in the collection that match the filter.
Finds all documents in the collection that match the filter.
Below is an example of filtering against the filename and some nested metadata that can also be stored along with the file data:
Filters.and(Filters.eq("filename", "mongodb.png"), Filters.eq("metadata.contentType", "image/png"));
the query filter
the GridFS find iterable interface
com.mongodb.client.model.Filters
Finds all documents in the files collection.
Opens a Stream from which the application can read the contents of the stored file specified by filename
and the revision
in options
.
Opens a Stream from which the application can read the contents of the stored file specified by filename
and the revision
in options
.
the client session with which to associate this operation
the name of the file to be downloaded
the download options
the stream
2.2
Requires MongoDB 3.6 or greater
Opens a Stream from which the application can read the contents of the latest version of the stored file specified by the
filename
.
Opens a Stream from which the application can read the contents of the latest version of the stored file specified by the
filename
.
the client session with which to associate this operation
the name of the file to be downloaded
the stream
2.2
Requires MongoDB 3.6 or greater
Opens a AsyncInputStream from which the application can read the contents of the stored file specified by id
.
Opens a AsyncInputStream from which the application can read the contents of the stored file specified by id
.
the client session with which to associate this operation
the custom id value of the file, to be put into a stream.
the stream
2.2
Requires MongoDB 3.6 or greater
Opens a AsyncInputStream from which the application can read the contents of the stored file specified by id
.
Opens a AsyncInputStream from which the application can read the contents of the stored file specified by id
.
the client session with which to associate this operation
the ObjectId of the file to be put into a stream.
the stream
2.2
Requires MongoDB 3.6 or greater
Opens a Stream from which the application can read the contents of the stored file specified by filename
and the revision
in options
.
Opens a Stream from which the application can read the contents of the stored file specified by filename
and the revision
in options
.
the name of the file to be downloaded
the download options
the stream
Opens a Stream from which the application can read the contents of the latest version of the stored file specified by the
filename
.
Opens a Stream from which the application can read the contents of the latest version of the stored file specified by the
filename
.
the name of the file to be downloaded
the stream
Opens a AsyncInputStream from which the application can read the contents of the stored file specified by id
.
Opens a AsyncInputStream from which the application can read the contents of the stored file specified by id
.
the custom id value of the file, to be put into a stream.
the stream
Opens a AsyncInputStream from which the application can read the contents of the stored file specified by id
.
Opens a AsyncInputStream from which the application can read the contents of the stored file specified by id
.
the ObjectId of the file to be put into a stream.
the stream
Opens a AsyncOutputStream that the application can write the contents of the file to.
Opens a AsyncOutputStream that the application can write the contents of the file to.
As the application writes the contents to the returned Stream, the contents are uploaded as chunks in the chunks collection. When the application signals it is done writing the contents of the file by calling close on the returned Stream, a files collection document is created in the files collection.
the client session with which to associate this operation
the custom id value of the file
the filename for the stream
the GridFSUploadOptions
the GridFSUploadStream that provides the ObjectId for the file to be uploaded and the Stream to which the application will write the contents.
2.2
Requires MongoDB 3.6 or greater
Opens a AsyncOutputStream that the application can write the contents of the file to.
Opens a AsyncOutputStream that the application can write the contents of the file to.
As the application writes the contents to the returned Stream, the contents are uploaded as chunks in the chunks collection. When the application signals it is done writing the contents of the file by calling close on the returned Stream, a files collection document is created in the files collection.
the client session with which to associate this operation
the custom id value of the file
the filename for the stream
the GridFSUploadStream that provides the ObjectId for the file to be uploaded and the Stream to which the application will write the contents.
2.2
Requires MongoDB 3.6 or greater
Opens a AsyncOutputStream that the application can write the contents of the file to.
Opens a AsyncOutputStream that the application can write the contents of the file to.
As the application writes the contents to the returned Stream, the contents are uploaded as chunks in the chunks collection. When the application signals it is done writing the contents of the file by calling close on the returned Stream, a files collection document is created in the files collection.
the client session with which to associate this operation
the filename for the stream
the GridFSUploadOptions
the GridFSUploadStream that provides the ObjectId for the file to be uploaded and the Stream to which the application will write the contents.
2.2
Requires MongoDB 3.6 or greater
Opens a AsyncOutputStream that the application can write the contents of the file to.
Opens a AsyncOutputStream that the application can write the contents of the file to.
As the application writes the contents to the returned Stream, the contents are uploaded as chunks in the chunks collection. When the application signals it is done writing the contents of the file by calling close on the returned Stream, a files collection document is created in the files collection.
the client session with which to associate this operation
the filename for the stream
the GridFSUploadStream that provides the ObjectId for the file to be uploaded and the Stream to which the application will write the contents.
2.2
Requires MongoDB 3.6 or greater
Opens a AsyncOutputStream that the application can write the contents of the file to.
Opens a AsyncOutputStream that the application can write the contents of the file to.
As the application writes the contents to the returned Stream, the contents are uploaded as chunks in the chunks collection. When the application signals it is done writing the contents of the file by calling close on the returned Stream, a files collection document is created in the files collection.
the custom id value of the file
the filename for the stream
the GridFSUploadOptions
the GridFSUploadStream that provides the ObjectId for the file to be uploaded and the Stream to which the application will write the contents.
Opens a AsyncOutputStream that the application can write the contents of the file to.
Opens a AsyncOutputStream that the application can write the contents of the file to.
As the application writes the contents to the returned Stream, the contents are uploaded as chunks in the chunks collection. When the application signals it is done writing the contents of the file by calling close on the returned Stream, a files collection document is created in the files collection.
the custom id value of the file
the filename for the stream
the GridFSUploadStream that provides the ObjectId for the file to be uploaded and the Stream to which the application will write the contents.
Opens a AsyncOutputStream that the application can write the contents of the file to.
Opens a AsyncOutputStream that the application can write the contents of the file to.
As the application writes the contents to the returned Stream, the contents are uploaded as chunks in the chunks collection. When the application signals it is done writing the contents of the file by calling close on the returned Stream, a files collection document is created in the files collection.
the filename for the stream
the GridFSUploadOptions
the GridFSUploadStream that provides the ObjectId for the file to be uploaded and the Stream to which the application will write the contents.
Opens a AsyncOutputStream that the application can write the contents of the file to.
Opens a AsyncOutputStream that the application can write the contents of the file to.
As the application writes the contents to the returned Stream, the contents are uploaded as chunks in the chunks collection. When the application signals it is done writing the contents of the file by calling close on the returned Stream, a files collection document is created in the files collection.
the filename for the stream
the GridFSUploadStream that provides the ObjectId for the file to be uploaded and the Stream to which the application will write the contents.
Get the read concern for the GridFSBucket.
Get the read concern for the GridFSBucket.
the ReadConcern
Requires MongoDB 3.2 or greater
Get the read preference for the GridFSBucket.
Get the read preference for the GridFSBucket.
the ReadPreference
Renames the stored file with the specified id
.
Renames the stored file with the specified id
.
the client session with which to associate this operation
the id of the file in the files collection to rename
the new filename for the file
a Observable with a single element indicating when the operation has completed
2.2
Requires MongoDB 3.6 or greater
Renames the stored file with the specified id
.
Renames the stored file with the specified id
.
the client session with which to associate this operation
the id of the file in the files collection to rename
the new filename for the file
a Observable with a single element indicating when the operation has completed
2.2
Requires MongoDB 3.6 or greater
Renames the stored file with the specified id
.
Renames the stored file with the specified id
.
the id of the file in the files collection to rename
the new filename for the file
a Observable with a single element indicating when the operation has completed
Renames the stored file with the specified id
.
Renames the stored file with the specified id
.
the id of the file in the files collection to rename
the new filename for the file
a Observable with a single element indicating when the operation has completed
Uploads the contents of the given AsyncInputStream
to a GridFS bucket.
Uploads the contents of the given AsyncInputStream
to a GridFS bucket.
Reads the contents of the user file from the source
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.
the client session with which to associate this operation
the custom id value of the file
the filename for the stream
the Stream providing the file data
the GridFSUploadOptions
a Observable with a single element indicating when the operation has completed
2.2
Requires MongoDB 3.6 or greater
Uploads the contents of the given AsyncInputStream
to a GridFS bucket.
Uploads the contents of the given AsyncInputStream
to a GridFS bucket.
Reads the contents of the user file from the source
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.
the client session with which to associate this operation
the custom id value of the file
the filename for the stream
the Stream providing the file data
a Observable with a single element indicating when the operation has completed
2.2
Requires MongoDB 3.6 or greater
Uploads the contents of the given AsyncInputStream
to a GridFS bucket.
Uploads the contents of the given AsyncInputStream
to a GridFS bucket.
Reads the contents of the user file from the source
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.
the client session with which to associate this operation
the filename for the stream
the Stream providing the file data
the GridFSUploadOptions
a Observable returning a single element containing the ObjectId of the uploaded file.
2.2
Requires MongoDB 3.6 or greater
Uploads the contents of the given AsyncInputStream
to a GridFS bucket.
Uploads the contents of the given AsyncInputStream
to a GridFS bucket.
Reads the contents of the user file from the source
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.
the client session with which to associate this operation
the filename for the stream
the Stream providing the file data
a Observable returning a single element containing the ObjectId of the uploaded file.
2.2
Requires MongoDB 3.6 or greater
Uploads the contents of the given AsyncInputStream
to a GridFS bucket.
Uploads the contents of the given AsyncInputStream
to a GridFS bucket.
Reads the contents of the user file from the source
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.
the custom id value of the file
the filename for the stream
the Stream providing the file data
the GridFSUploadOptions
a Observable with a single element indicating when the operation has completed
Uploads the contents of the given AsyncInputStream
to a GridFS bucket.
Uploads the contents of the given AsyncInputStream
to a GridFS bucket.
Reads the contents of the user file from the source
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.
the custom id value of the file
the filename for the stream
the Stream providing the file data
a Observable with a single element indicating when the operation has completed
Uploads the contents of the given AsyncInputStream
to a GridFS bucket.
Uploads the contents of the given AsyncInputStream
to a GridFS bucket.
Reads the contents of the user file from the source
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.
the filename for the stream
the Stream providing the file data
the GridFSUploadOptions
a Observable returning a single element containing the ObjectId of the uploaded file.
Uploads the contents of the given AsyncInputStream to a GridFS bucket.
Uploads the contents of the given AsyncInputStream to a GridFS bucket.
Reads the contents of the user file from the source
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.
the filename for the stream
the Stream providing the file data
a Observable returning a single element containing the ObjectId of the uploaded file.
Create a new GridFSBucket instance with a new chunk size in bytes.
Create a new GridFSBucket instance with a new chunk size in bytes.
the new chunk size in bytes.
a new GridFSBucket instance with the different chunk size in bytes
Create a new MongoDatabase instance with a different read concern.
Create a new MongoDatabase instance with a different read concern.
the new ReadConcern for the database
a new GridFSBucket instance with the different ReadConcern
Requires MongoDB 3.2 or greater
Create a new GridFSBucket instance with a different read preference.
Create a new GridFSBucket instance with a different read preference.
the new ReadPreference for the database
a new GridFSBucket instance with the different readPreference
Create a new GridFSBucket instance with a different write concern.
Create a new GridFSBucket instance with a different write concern.
the new WriteConcern for the database
a new GridFSBucket instance with the different writeConcern
Get the write concern for the GridFSBucket.
Get the write concern for the GridFSBucket.
the WriteConcern
Represents a GridFS Bucket
1.2