@ThreadSafe
public interface GridFSBucket
| Modifier and Type | Method and Description |
|---|---|
org.reactivestreams.Publisher<Success> |
delete(org.bson.BsonValue id)
Given a
id, delete this stored file's files collection document and associated chunks from a GridFS bucket. |
org.reactivestreams.Publisher<Success> |
delete(ClientSession clientSession,
org.bson.BsonValue id)
Given a
id, delete this stored file's files collection document and associated chunks from a GridFS bucket. |
org.reactivestreams.Publisher<Success> |
delete(ClientSession clientSession,
org.bson.types.ObjectId id)
Given a
id, delete this stored file's files collection document and associated chunks from a GridFS bucket. |
org.reactivestreams.Publisher<Success> |
delete(org.bson.types.ObjectId id)
Given a
id, delete this stored file's files collection document and associated chunks from a GridFS bucket. |
GridFSDownloadPublisher |
downloadToPublisher(org.bson.BsonValue id)
Downloads the contents of the stored file specified by
id into the Publisher. |
GridFSDownloadPublisher |
downloadToPublisher(ClientSession clientSession,
org.bson.BsonValue id)
Downloads the contents of the stored file specified by
id into the Publisher. |
GridFSDownloadPublisher |
downloadToPublisher(ClientSession clientSession,
org.bson.types.ObjectId id)
Downloads the contents of the stored file specified by
id into the Publisher. |
GridFSDownloadPublisher |
downloadToPublisher(ClientSession clientSession,
String filename)
Downloads the contents of the latest version of the stored file specified by
filename into the Publisher. |
GridFSDownloadPublisher |
downloadToPublisher(ClientSession clientSession,
String filename,
com.mongodb.client.gridfs.model.GridFSDownloadOptions options)
Downloads the contents of the stored file specified by
filename and by the revision in options into the
Publisher. |
GridFSDownloadPublisher |
downloadToPublisher(org.bson.types.ObjectId id)
Downloads the contents of the stored file specified by
id into the Publisher. |
GridFSDownloadPublisher |
downloadToPublisher(String filename)
Downloads the contents of the stored file specified by
filename into the Publisher. |
GridFSDownloadPublisher |
downloadToPublisher(String filename,
com.mongodb.client.gridfs.model.GridFSDownloadOptions options)
Downloads the contents of the stored file specified by
filename and by the revision in options into the
Publisher. |
org.reactivestreams.Publisher<Long> |
downloadToStream(org.bson.BsonValue id,
AsyncOutputStream destination)
Deprecated.
prefer
downloadToPublisher(BsonValue) instead |
org.reactivestreams.Publisher<Long> |
downloadToStream(ClientSession clientSession,
org.bson.BsonValue id,
AsyncOutputStream destination)
Deprecated.
prefer
downloadToPublisher(ClientSession, BsonValue) instead |
org.reactivestreams.Publisher<Long> |
downloadToStream(ClientSession clientSession,
org.bson.types.ObjectId id,
AsyncOutputStream destination)
Deprecated.
prefer
downloadToPublisher(ClientSession, ObjectId) instead |
org.reactivestreams.Publisher<Long> |
downloadToStream(ClientSession clientSession,
String filename,
AsyncOutputStream destination)
Deprecated.
prefer
downloadToPublisher(ClientSession, String) instead |
org.reactivestreams.Publisher<Long> |
downloadToStream(ClientSession clientSession,
String filename,
AsyncOutputStream destination,
com.mongodb.client.gridfs.model.GridFSDownloadOptions options)
Deprecated.
|
org.reactivestreams.Publisher<Long> |
downloadToStream(org.bson.types.ObjectId id,
AsyncOutputStream destination)
Deprecated.
prefer
downloadToPublisher(ObjectId) instead |
org.reactivestreams.Publisher<Long> |
downloadToStream(String filename,
AsyncOutputStream destination)
Deprecated.
prefer
downloadToPublisher(String) instead |
org.reactivestreams.Publisher<Long> |
downloadToStream(String filename,
AsyncOutputStream destination,
com.mongodb.client.gridfs.model.GridFSDownloadOptions options)
Deprecated.
prefer
downloadToPublisher(String, GridFSDownloadOptions) instead |
org.reactivestreams.Publisher<Success> |
drop()
Drops the data associated with this bucket from the database.
|
org.reactivestreams.Publisher<Success> |
drop(ClientSession clientSession)
Drops the data associated with this bucket from the database.
|
GridFSFindPublisher |
find()
Finds all documents in the files collection.
|
GridFSFindPublisher |
find(org.bson.conversions.Bson filter)
Finds all documents in the collection that match the filter.
|
GridFSFindPublisher |
find(ClientSession clientSession)
Finds all documents in the files collection.
|
GridFSFindPublisher |
find(ClientSession clientSession,
org.bson.conversions.Bson filter)
Finds all documents in the collection that match the filter.
|
String |
getBucketName()
The bucket name.
|
int |
getChunkSizeBytes()
Sets the chunk size in bytes.
|
boolean |
getDisableMD5()
Returns true if computing MD5 checksums when uploading files is disabled.
|
com.mongodb.ReadConcern |
getReadConcern()
Get the read concern for the GridFSBucket.
|
com.mongodb.ReadPreference |
getReadPreference()
Get the read preference for the GridFSBucket.
|
com.mongodb.WriteConcern |
getWriteConcern()
Get the write concern for the GridFSBucket.
|
GridFSDownloadStream |
openDownloadStream(org.bson.BsonValue id)
Deprecated.
prefer
downloadToPublisher(BsonValue) instead |
GridFSDownloadStream |
openDownloadStream(ClientSession clientSession,
org.bson.BsonValue id)
Deprecated.
prefer
downloadToPublisher(ClientSession, BsonValue) instead |
GridFSDownloadStream |
openDownloadStream(ClientSession clientSession,
org.bson.types.ObjectId id)
Deprecated.
prefer
downloadToPublisher(ClientSession, ObjectId) instead |
GridFSDownloadStream |
openDownloadStream(ClientSession clientSession,
String filename)
Deprecated.
prefer
downloadToPublisher(ClientSession, String) instead |
GridFSDownloadStream |
openDownloadStream(ClientSession clientSession,
String filename,
com.mongodb.client.gridfs.model.GridFSDownloadOptions options)
Deprecated.
|
GridFSDownloadStream |
openDownloadStream(org.bson.types.ObjectId id)
Deprecated.
prefer
downloadToPublisher(ObjectId) instead |
GridFSDownloadStream |
openDownloadStream(String filename)
Deprecated.
prefer
downloadToPublisher(String) instead |
GridFSDownloadStream |
openDownloadStream(String filename,
com.mongodb.client.gridfs.model.GridFSDownloadOptions options)
Deprecated.
prefer
downloadToPublisher(String, GridFSDownloadOptions) instead |
GridFSUploadStream |
openUploadStream(org.bson.BsonValue id,
String filename)
Deprecated.
prefer
uploadFromPublisher(BsonValue, String, Publisher) instead |
GridFSUploadStream |
openUploadStream(org.bson.BsonValue id,
String filename,
com.mongodb.client.gridfs.model.GridFSUploadOptions options)
Deprecated.
|
GridFSUploadStream |
openUploadStream(ClientSession clientSession,
org.bson.BsonValue id,
String filename)
Deprecated.
|
GridFSUploadStream |
openUploadStream(ClientSession clientSession,
org.bson.BsonValue id,
String filename,
com.mongodb.client.gridfs.model.GridFSUploadOptions options)
Deprecated.
|
GridFSUploadStream |
openUploadStream(ClientSession clientSession,
String filename)
Deprecated.
prefer
uploadFromPublisher(ClientSession, String, Publisher) instead |
GridFSUploadStream |
openUploadStream(ClientSession clientSession,
String filename,
com.mongodb.client.gridfs.model.GridFSUploadOptions options)
Deprecated.
|
GridFSUploadStream |
openUploadStream(String filename)
Deprecated.
prefer
uploadFromPublisher(String, Publisher) instead |
GridFSUploadStream |
openUploadStream(String filename,
com.mongodb.client.gridfs.model.GridFSUploadOptions options)
Deprecated.
prefer
uploadFromPublisher(String, Publisher, GridFSUploadOptions) instead |
org.reactivestreams.Publisher<Success> |
rename(org.bson.BsonValue id,
String newFilename)
Renames the stored file with the specified
id. |
org.reactivestreams.Publisher<Success> |
rename(ClientSession clientSession,
org.bson.BsonValue id,
String newFilename)
Renames the stored file with the specified
id. |
org.reactivestreams.Publisher<Success> |
rename(ClientSession clientSession,
org.bson.types.ObjectId id,
String newFilename)
Renames the stored file with the specified
id. |
org.reactivestreams.Publisher<Success> |
rename(org.bson.types.ObjectId id,
String newFilename)
Renames the stored file with the specified
id. |
GridFSUploadPublisher<Success> |
uploadFromPublisher(org.bson.BsonValue id,
String filename,
org.reactivestreams.Publisher<ByteBuffer> source)
Uploads the contents of the given
Publisher to a GridFS bucket. |
GridFSUploadPublisher<Success> |
uploadFromPublisher(org.bson.BsonValue id,
String filename,
org.reactivestreams.Publisher<ByteBuffer> source,
com.mongodb.client.gridfs.model.GridFSUploadOptions options)
Uploads the contents of the given
Publisher to a GridFS bucket. |
GridFSUploadPublisher<Success> |
uploadFromPublisher(ClientSession clientSession,
org.bson.BsonValue id,
String filename,
org.reactivestreams.Publisher<ByteBuffer> source)
Uploads the contents of the given
Publisher to a GridFS bucket. |
GridFSUploadPublisher<Success> |
uploadFromPublisher(ClientSession clientSession,
org.bson.BsonValue id,
String filename,
org.reactivestreams.Publisher<ByteBuffer> source,
com.mongodb.client.gridfs.model.GridFSUploadOptions options)
Uploads the contents of the given
Publisher to a GridFS bucket. |
GridFSUploadPublisher<org.bson.types.ObjectId> |
uploadFromPublisher(ClientSession clientSession,
String filename,
org.reactivestreams.Publisher<ByteBuffer> source)
Uploads the contents of the given
Publisher to a GridFS bucket. |
GridFSUploadPublisher<org.bson.types.ObjectId> |
uploadFromPublisher(ClientSession clientSession,
String filename,
org.reactivestreams.Publisher<ByteBuffer> source,
com.mongodb.client.gridfs.model.GridFSUploadOptions options)
Uploads the contents of the given
Publisher to a GridFS bucket. |
GridFSUploadPublisher<org.bson.types.ObjectId> |
uploadFromPublisher(String filename,
org.reactivestreams.Publisher<ByteBuffer> source)
Uploads the contents of the given
Publisher to a GridFS bucket. |
GridFSUploadPublisher<org.bson.types.ObjectId> |
uploadFromPublisher(String filename,
org.reactivestreams.Publisher<ByteBuffer> source,
com.mongodb.client.gridfs.model.GridFSUploadOptions options)
Uploads the contents of the given
Publisher to a GridFS bucket. |
org.reactivestreams.Publisher<Success> |
uploadFromStream(org.bson.BsonValue id,
String filename,
AsyncInputStream source)
Deprecated.
prefer
uploadFromPublisher(BsonValue, String, Publisher) instead |
org.reactivestreams.Publisher<Success> |
uploadFromStream(org.bson.BsonValue id,
String filename,
AsyncInputStream source,
com.mongodb.client.gridfs.model.GridFSUploadOptions options)
Deprecated.
|
org.reactivestreams.Publisher<Success> |
uploadFromStream(ClientSession clientSession,
org.bson.BsonValue id,
String filename,
AsyncInputStream source)
Deprecated.
|
org.reactivestreams.Publisher<Success> |
uploadFromStream(ClientSession clientSession,
org.bson.BsonValue id,
String filename,
AsyncInputStream source,
com.mongodb.client.gridfs.model.GridFSUploadOptions options)
Deprecated.
|
org.reactivestreams.Publisher<org.bson.types.ObjectId> |
uploadFromStream(ClientSession clientSession,
String filename,
AsyncInputStream source)
Deprecated.
prefer
uploadFromPublisher(ClientSession, String, Publisher) instead |
org.reactivestreams.Publisher<org.bson.types.ObjectId> |
uploadFromStream(ClientSession clientSession,
String filename,
AsyncInputStream source,
com.mongodb.client.gridfs.model.GridFSUploadOptions options)
Deprecated.
|
org.reactivestreams.Publisher<org.bson.types.ObjectId> |
uploadFromStream(String filename,
AsyncInputStream source)
Deprecated.
prefer
uploadFromPublisher(String, Publisher) instead |
org.reactivestreams.Publisher<org.bson.types.ObjectId> |
uploadFromStream(String filename,
AsyncInputStream source,
com.mongodb.client.gridfs.model.GridFSUploadOptions options)
Deprecated.
prefer
uploadFromPublisher(String, Publisher, GridFSUploadOptions) instead |
GridFSBucket |
withChunkSizeBytes(int chunkSizeBytes)
Create a new GridFSBucket instance with a new chunk size in bytes.
|
GridFSBucket |
withDisableMD5(boolean disableMD5)
Create a new GridFSBucket instance with the set disable MD5 value.
|
GridFSBucket |
withReadConcern(com.mongodb.ReadConcern readConcern)
Create a new MongoDatabase instance with a different read concern.
|
GridFSBucket |
withReadPreference(com.mongodb.ReadPreference readPreference)
Create a new GridFSBucket instance with a different read preference.
|
GridFSBucket |
withWriteConcern(com.mongodb.WriteConcern writeConcern)
Create a new GridFSBucket instance with a different write concern.
|
String getBucketName()
int getChunkSizeBytes()
com.mongodb.WriteConcern getWriteConcern()
WriteConcerncom.mongodb.ReadPreference getReadPreference()
ReadPreferencecom.mongodb.ReadConcern getReadConcern()
ReadConcernboolean getDisableMD5()
GridFSBucket withChunkSizeBytes(int chunkSizeBytes)
chunkSizeBytes - the new chunk size in bytes.GridFSBucket withReadPreference(com.mongodb.ReadPreference readPreference)
readPreference - the new ReadPreference for the databaseGridFSBucket withWriteConcern(com.mongodb.WriteConcern writeConcern)
writeConcern - the new WriteConcern for the databaseGridFSBucket withReadConcern(com.mongodb.ReadConcern readConcern)
readConcern - the new ReadConcern for the databaseGridFSBucket withDisableMD5(boolean disableMD5)
disableMD5 - true if computing MD5 checksums when uploading files should be disabled.@Deprecated GridFSUploadStream openUploadStream(String filename)
uploadFromPublisher(String, Publisher) insteadAs 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.
filename - the filename for the stream@Deprecated GridFSUploadStream openUploadStream(String filename, com.mongodb.client.gridfs.model.GridFSUploadOptions options)
uploadFromPublisher(String, Publisher, GridFSUploadOptions) insteadAs 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.
filename - the filename for the streamoptions - the GridFSUploadOptions@Deprecated GridFSUploadStream openUploadStream(org.bson.BsonValue id, String filename)
uploadFromPublisher(BsonValue, String, Publisher) insteadAs 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.
id - the custom id value of the filefilename - the filename for the stream@Deprecated GridFSUploadStream openUploadStream(org.bson.BsonValue id, String filename, com.mongodb.client.gridfs.model.GridFSUploadOptions options)
uploadFromPublisher(BsonValue, String, Publisher, GridFSUploadOptions) insteadAs 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.
id - the custom id value of the filefilename - the filename for the streamoptions - the GridFSUploadOptions@Deprecated GridFSUploadStream openUploadStream(ClientSession clientSession, String filename)
uploadFromPublisher(ClientSession, String, Publisher) insteadAs 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.
clientSession - the client session with which to associate this operationfilename - the filename for the stream@Deprecated GridFSUploadStream openUploadStream(ClientSession clientSession, String filename, com.mongodb.client.gridfs.model.GridFSUploadOptions options)
uploadFromPublisher(ClientSession, String, Publisher, GridFSUploadOptions) insteadAs 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.
clientSession - the client session with which to associate this operationfilename - the filename for the streamoptions - the GridFSUploadOptions@Deprecated GridFSUploadStream openUploadStream(ClientSession clientSession, org.bson.BsonValue id, String filename)
uploadFromPublisher(ClientSession, BsonValue, String, Publisher) insteadAs 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.
clientSession - the client session with which to associate this operationid - the custom id value of the filefilename - the filename for the stream@Deprecated GridFSUploadStream openUploadStream(ClientSession clientSession, org.bson.BsonValue id, String filename, com.mongodb.client.gridfs.model.GridFSUploadOptions options)
uploadFromPublisher(ClientSession, BsonValue, String, Publisher, GridFSUploadOptions) insteadAs 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.
clientSession - the client session with which to associate this operationid - the custom id value of the filefilename - the filename for the streamoptions - the GridFSUploadOptions@Deprecated org.reactivestreams.Publisher<org.bson.types.ObjectId> uploadFromStream(String filename, AsyncInputStream source)
uploadFromPublisher(String, Publisher) insteadAsyncInputStream 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.
filename - the filename for the streamsource - the Stream providing the file data@Deprecated org.reactivestreams.Publisher<org.bson.types.ObjectId> uploadFromStream(String filename, AsyncInputStream source, com.mongodb.client.gridfs.model.GridFSUploadOptions options)
uploadFromPublisher(String, Publisher, GridFSUploadOptions) insteadAsyncInputStream 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.
filename - the filename for the streamsource - the Stream providing the file dataoptions - the GridFSUploadOptions@Deprecated org.reactivestreams.Publisher<Success> uploadFromStream(org.bson.BsonValue id, String filename, AsyncInputStream source)
uploadFromPublisher(BsonValue, String, Publisher) insteadAsyncInputStream 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.
id - the custom id value of the filefilename - the filename for the streamsource - the Stream providing the file data@Deprecated org.reactivestreams.Publisher<Success> uploadFromStream(org.bson.BsonValue id, String filename, AsyncInputStream source, com.mongodb.client.gridfs.model.GridFSUploadOptions options)
uploadFromPublisher(BsonValue, String, Publisher, GridFSUploadOptions) insteadAsyncInputStream 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.
id - the custom id value of the filefilename - the filename for the streamsource - the Stream providing the file dataoptions - the GridFSUploadOptions@Deprecated org.reactivestreams.Publisher<org.bson.types.ObjectId> uploadFromStream(ClientSession clientSession, String filename, AsyncInputStream source)
uploadFromPublisher(ClientSession, String, Publisher) insteadAsyncInputStream 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.
clientSession - the client session with which to associate this operationfilename - the filename for the streamsource - the Stream providing the file data@Deprecated org.reactivestreams.Publisher<org.bson.types.ObjectId> uploadFromStream(ClientSession clientSession, String filename, AsyncInputStream source, com.mongodb.client.gridfs.model.GridFSUploadOptions options)
uploadFromPublisher(ClientSession, String, Publisher, GridFSUploadOptions) insteadAsyncInputStream 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.
clientSession - the client session with which to associate this operationfilename - the filename for the streamsource - the Stream providing the file dataoptions - the GridFSUploadOptions@Deprecated org.reactivestreams.Publisher<Success> uploadFromStream(ClientSession clientSession, org.bson.BsonValue id, String filename, AsyncInputStream source)
uploadFromPublisher(ClientSession, BsonValue, String, Publisher) insteadAsyncInputStream 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.
clientSession - the client session with which to associate this operationid - the custom id value of the filefilename - the filename for the streamsource - the Stream providing the file data@Deprecated org.reactivestreams.Publisher<Success> uploadFromStream(ClientSession clientSession, org.bson.BsonValue id, String filename, AsyncInputStream source, com.mongodb.client.gridfs.model.GridFSUploadOptions options)
uploadFromPublisher(ClientSession, BsonValue, String, Publisher, GridFSUploadOptions) insteadAsyncInputStream 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.
clientSession - the client session with which to associate this operationid - the custom id value of the filefilename - the filename for the streamsource - the Stream providing the file dataoptions - the GridFSUploadOptions@Deprecated GridFSDownloadStream openDownloadStream(org.bson.types.ObjectId id)
downloadToPublisher(ObjectId) insteadAsyncInputStream from which the application can read the contents of the stored file specified by id.id - the ObjectId of the file to be put into a stream.@Deprecated GridFSDownloadStream openDownloadStream(org.bson.BsonValue id)
downloadToPublisher(BsonValue) insteadAsyncInputStream from which the application can read the contents of the stored file specified by id.id - the custom id value of the file, to be put into a stream.@Deprecated GridFSDownloadStream openDownloadStream(String filename)
downloadToPublisher(String) insteadAsyncInputStream from which the application can read the contents of the latest version of the stored file specified
by the filename.filename - the name of the file to be downloaded@Deprecated GridFSDownloadStream openDownloadStream(String filename, com.mongodb.client.gridfs.model.GridFSDownloadOptions options)
downloadToPublisher(String, GridFSDownloadOptions) insteadAsyncInputStream from which the application can read the contents of the stored file specified by filename
and the revision in options.filename - the name of the file to be downloadedoptions - the download options@Deprecated GridFSDownloadStream openDownloadStream(ClientSession clientSession, org.bson.types.ObjectId id)
downloadToPublisher(ClientSession, ObjectId) insteadAsyncInputStream from which the application can read the contents of the stored file specified by id.clientSession - the client session with which to associate this operationid - the ObjectId of the file to be put into a stream.@Deprecated GridFSDownloadStream openDownloadStream(ClientSession clientSession, org.bson.BsonValue id)
downloadToPublisher(ClientSession, BsonValue) insteadAsyncInputStream from which the application can read the contents of the stored file specified by id.clientSession - the client session with which to associate this operationid - the custom id value of the file, to be put into a stream.@Deprecated GridFSDownloadStream openDownloadStream(ClientSession clientSession, String filename)
downloadToPublisher(ClientSession, String) insteadAsyncInputStream from which the application can read the contents of the latest version of the stored file
specified by the filename.clientSession - the client session with which to associate this operationfilename - the name of the file to be downloaded@Deprecated GridFSDownloadStream openDownloadStream(ClientSession clientSession, String filename, com.mongodb.client.gridfs.model.GridFSDownloadOptions options)
downloadToPublisher(ClientSession, String, GridFSDownloadOptions) insteadAsyncInputStream from which the application can read the contents of the stored file specified by
filename and the revision in options.clientSession - the client session with which to associate this operationfilename - the name of the file to be downloadedoptions - the download options@Deprecated org.reactivestreams.Publisher<Long> downloadToStream(org.bson.types.ObjectId id, AsyncOutputStream destination)
downloadToPublisher(ObjectId) insteadid and writes the contents to the destination
AsyncOutputStream.id - the ObjectId of the file to be written to the destination streamdestination - the destination stream@Deprecated org.reactivestreams.Publisher<Long> downloadToStream(org.bson.BsonValue id, AsyncOutputStream destination)
downloadToPublisher(BsonValue) insteadid and writes the contents to the destination
AsyncOutputStream.id - the custom id of the file, to be written to the destination streamdestination - the destination stream@Deprecated org.reactivestreams.Publisher<Long> downloadToStream(String filename, AsyncOutputStream destination)
downloadToPublisher(String) insteadfilename and writes the contents to
the destination Stream.filename - the name of the file to be downloadeddestination - the destination stream@Deprecated org.reactivestreams.Publisher<Long> downloadToStream(String filename, AsyncOutputStream destination, com.mongodb.client.gridfs.model.GridFSDownloadOptions options)
downloadToPublisher(String, GridFSDownloadOptions) insteadfilename and by the revision in options and writes the
contents to the destination Stream.filename - the name of the file to be downloadeddestination - the destination streamoptions - the download options@Deprecated org.reactivestreams.Publisher<Long> downloadToStream(ClientSession clientSession, org.bson.types.ObjectId id, AsyncOutputStream destination)
downloadToPublisher(ClientSession, ObjectId) insteadid and writes the contents to the destination
AsyncOutputStream.clientSession - the client session with which to associate this operationid - the ObjectId of the file to be written to the destination streamdestination - the destination stream@Deprecated org.reactivestreams.Publisher<Long> downloadToStream(ClientSession clientSession, org.bson.BsonValue id, AsyncOutputStream destination)
downloadToPublisher(ClientSession, BsonValue) insteadid and writes the contents to the destination
AsyncOutputStream.clientSession - the client session with which to associate this operationid - the custom id of the file, to be written to the destination streamdestination - the destination stream@Deprecated org.reactivestreams.Publisher<Long> downloadToStream(ClientSession clientSession, String filename, AsyncOutputStream destination)
downloadToPublisher(ClientSession, String) insteadfilename and writes the contents to
the destination Stream.clientSession - the client session with which to associate this operationfilename - the name of the file to be downloadeddestination - the destination stream@Deprecated org.reactivestreams.Publisher<Long> downloadToStream(ClientSession clientSession, String filename, AsyncOutputStream destination, com.mongodb.client.gridfs.model.GridFSDownloadOptions options)
downloadToPublisher(ClientSession, String, GridFSDownloadOptions) insteadfilename and by the revision in options and writes the
contents to the destination Stream.clientSession - the client session with which to associate this operationfilename - the name of the file to be downloadeddestination - the destination streamoptions - the download optionsGridFSUploadPublisher<org.bson.types.ObjectId> uploadFromPublisher(String filename, org.reactivestreams.Publisher<ByteBuffer> source)
Publisher 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.
filename - the filename for the streamsource - the Publisher providing the file dataGridFSUploadPublisher<org.bson.types.ObjectId> uploadFromPublisher(String filename, org.reactivestreams.Publisher<ByteBuffer> source, com.mongodb.client.gridfs.model.GridFSUploadOptions options)
Publisher 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.
filename - the filename for the streamsource - the Publisher providing the file dataoptions - the GridFSUploadOptionsGridFSUploadPublisher<Success> uploadFromPublisher(org.bson.BsonValue id, String filename, org.reactivestreams.Publisher<ByteBuffer> source)
Publisher 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.
id - the custom id value of the filefilename - the filename for the streamsource - the Publisher providing the file dataGridFSUploadPublisher<Success> uploadFromPublisher(org.bson.BsonValue id, String filename, org.reactivestreams.Publisher<ByteBuffer> source, com.mongodb.client.gridfs.model.GridFSUploadOptions options)
Publisher 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.
id - the custom id value of the filefilename - the filename for the streamsource - the Publisher providing the file dataoptions - the GridFSUploadOptionsGridFSUploadPublisher<org.bson.types.ObjectId> uploadFromPublisher(ClientSession clientSession, String filename, org.reactivestreams.Publisher<ByteBuffer> source)
Publisher 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.
clientSession - the client session with which to associate this operationfilename - the filename for the streamsource - the Publisher providing the file dataGridFSUploadPublisher<org.bson.types.ObjectId> uploadFromPublisher(ClientSession clientSession, String filename, org.reactivestreams.Publisher<ByteBuffer> source, com.mongodb.client.gridfs.model.GridFSUploadOptions options)
Publisher 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.
clientSession - the client session with which to associate this operationfilename - the filename for the streamsource - the Publisher providing the file dataoptions - the GridFSUploadOptionsGridFSUploadPublisher<Success> uploadFromPublisher(ClientSession clientSession, org.bson.BsonValue id, String filename, org.reactivestreams.Publisher<ByteBuffer> source)
Publisher 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.
clientSession - the client session with which to associate this operationid - the custom id value of the filefilename - the filename for the streamsource - the Publisher providing the file dataGridFSUploadPublisher<Success> uploadFromPublisher(ClientSession clientSession, org.bson.BsonValue id, String filename, org.reactivestreams.Publisher<ByteBuffer> source, com.mongodb.client.gridfs.model.GridFSUploadOptions options)
Publisher 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.
clientSession - the client session with which to associate this operationid - the custom id value of the filefilename - the filename for the streamsource - the Publisher providing the file dataoptions - the GridFSUploadOptionsGridFSDownloadPublisher downloadToPublisher(org.bson.types.ObjectId id)
id into the Publisher.id - the ObjectId of the file to be written to the destination streamGridFSDownloadPublisher downloadToPublisher(org.bson.BsonValue id)
id into the Publisher.id - the custom id of the file, to be written to the destination streamGridFSDownloadPublisher downloadToPublisher(String filename)
filename into the Publisher.filename - the name of the file to be downloadedGridFSDownloadPublisher downloadToPublisher(String filename, com.mongodb.client.gridfs.model.GridFSDownloadOptions options)
filename and by the revision in options into the
Publisher.filename - the name of the file to be downloadedoptions - the download optionsGridFSDownloadPublisher downloadToPublisher(ClientSession clientSession, org.bson.types.ObjectId id)
id into the Publisher.clientSession - the client session with which to associate this operationid - the ObjectId of the file to be written to the destination streamGridFSDownloadPublisher downloadToPublisher(ClientSession clientSession, org.bson.BsonValue id)
id into the Publisher.clientSession - the client session with which to associate this operationid - the custom id of the file, to be written to the destination streamGridFSDownloadPublisher downloadToPublisher(ClientSession clientSession, String filename)
filename into the Publisher.clientSession - the client session with which to associate this operationfilename - the name of the file to be downloadedGridFSDownloadPublisher downloadToPublisher(ClientSession clientSession, String filename, com.mongodb.client.gridfs.model.GridFSDownloadOptions options)
filename and by the revision in options into the
Publisher.clientSession - the client session with which to associate this operationfilename - the name of the file to be downloadedoptions - the download optionsGridFSFindPublisher find()
GridFSFindPublisher find(org.bson.conversions.Bson 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"));
filter - the query filterFiltersGridFSFindPublisher find(ClientSession clientSession)
GridFSFindPublisher find(ClientSession clientSession, org.bson.conversions.Bson 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"));
clientSession - the client session with which to associate this operationfilter - the query filterFiltersorg.reactivestreams.Publisher<Success> delete(org.bson.types.ObjectId id)
id, delete this stored file's files collection document and associated chunks from a GridFS bucket.id - the ObjectId of the file to be deletedorg.reactivestreams.Publisher<Success> delete(org.bson.BsonValue id)
id, delete this stored file's files collection document and associated chunks from a GridFS bucket.id - the ObjectId of the file to be deletedorg.reactivestreams.Publisher<Success> delete(ClientSession clientSession, org.bson.types.ObjectId id)
id, delete this stored file's files collection document and associated chunks from a GridFS bucket.clientSession - the client session with which to associate this operationid - the ObjectId of the file to be deletedorg.reactivestreams.Publisher<Success> delete(ClientSession clientSession, org.bson.BsonValue id)
id, delete this stored file's files collection document and associated chunks from a GridFS bucket.clientSession - the client session with which to associate this operationid - the ObjectId of the file to be deletedorg.reactivestreams.Publisher<Success> rename(org.bson.types.ObjectId id, String newFilename)
id.id - the id of the file in the files collection to renamenewFilename - the new filename for the fileorg.reactivestreams.Publisher<Success> rename(org.bson.BsonValue id, String newFilename)
id.id - the id of the file in the files collection to renamenewFilename - the new filename for the fileorg.reactivestreams.Publisher<Success> rename(ClientSession clientSession, org.bson.types.ObjectId id, String newFilename)
id.clientSession - the client session with which to associate this operationid - the id of the file in the files collection to renamenewFilename - the new filename for the fileorg.reactivestreams.Publisher<Success> rename(ClientSession clientSession, org.bson.BsonValue id, String newFilename)
id.clientSession - the client session with which to associate this operationid - the id of the file in the files collection to renamenewFilename - the new filename for the fileorg.reactivestreams.Publisher<Success> drop()
org.reactivestreams.Publisher<Success> drop(ClientSession clientSession)
clientSession - the client session with which to associate this operation