47#include <system_error>
253 std::ostream& output,
A polyfill for std::string_view.
Definition string_view.hpp:412
A non-owning, read-only union of BSON type values.
Definition view.hpp:1023
A MongoDB client session.
Definition client_session.hpp:48
A MongoDB cursor.
Definition cursor.hpp:41
Options for a "find" command.
Definition find_options.hpp:72
Options for mongocxx::v1::gridfs::bucket.
Definition bucket.hpp:345
options & read_concern(v1::read_concern v)
Set the "readConcern" field.
options(options &&other) noexcept
Move constructor.
~options()
Destroy this object.
options & chunk_size_bytes(std::int32_t v)
Set the "chunkSizeBytes" field.
options & bucket_name(std::string v)
Set the "bucketName" field.
options & write_concern(v1::write_concern v)
Set the "writeConcern" field.
options & read_preference(v1::read_preference v)
Set the "readPreference" field.
~bucket()
Destroy this object.
errc
Errors codes which may be returned by mongocxx::v1::gridfs::bucket.
Definition bucket.hpp:298
@ not_found
The requested GridFS file does not exist.
Definition bucket.hpp:302
@ invalid_bucket_name
The "bucketName" field must not be empty.
Definition bucket.hpp:300
@ corrupt_data
The GridFS file is in an invalid or inconsistent state.
Definition bucket.hpp:303
@ zero
Zero.
Definition bucket.hpp:299
@ invalid_byte_range
[start, end) must be a valid range of byte indexes within the requested GridFS file.
Definition bucket.hpp:304
@ invalid_chunk_size_bytes
The "chunkSizeBytes" field must be a positive value.
Definition bucket.hpp:301
v1::cursor find(bsoncxx::v1::document::view filter, v1::find_options const &opts={})
Find files within this bucket matching the given query filter.
bsoncxx::v1::stdx::string_view bucket_name() const
Return the name of this bucket.
v1::gridfs::downloader open_download_stream(bsoncxx::v1::types::view id)
Return a downloader for the requested file from this bucket.
v1::gridfs::uploader open_upload_stream_with_id(v1::client_session const &session, bsoncxx::v1::types::view id, bsoncxx::v1::stdx::string_view filename, v1::gridfs::upload_options const &opts={})
Return an uploader for a new file to this bucket.
bucket(bucket &&other) noexcept
Move constructor.
v1::gridfs::upload_result upload_from_stream(bsoncxx::v1::stdx::string_view filename, std::istream &input, v1::gridfs::upload_options const &opts={})
Equivalent to upload_from_stream_with_id with a file ID generated using bsoncxx::v1::oid.
v1::gridfs::downloader open_download_stream(v1::client_session const &session, bsoncxx::v1::types::view id)
Return a downloader for the requested file from this bucket.
void upload_from_stream_with_id(v1::client_session const &session, bsoncxx::v1::types::view id, bsoncxx::v1::stdx::string_view filename, std::istream &input, v1::gridfs::upload_options const &opts={})
Upload the contents of input as a new file to this bucket.
friend std::error_code make_error_code(errc v)
Support implicit conversion to std::error_code.
Definition bucket.hpp:319
v1::gridfs::uploader open_upload_stream(v1::client_session const &session, bsoncxx::v1::stdx::string_view filename, v1::gridfs::upload_options const &opts={})
Equivalent to open_upload_stream_with_id with a file ID generated using bsoncxx::v1::oid.
void delete_file(bsoncxx::v1::types::view id)
Delete the requested file from this bucket.
v1::gridfs::uploader open_upload_stream(bsoncxx::v1::stdx::string_view filename, v1::gridfs::upload_options const &opts={})
Equivalent to open_upload_stream_with_id with a file ID generated using bsoncxx::v1::oid.
void download_to_stream(bsoncxx::v1::types::view id, std::ostream &output)
Download the entire contents of the requested file from this bucket into output.
v1::gridfs::uploader open_upload_stream_with_id(bsoncxx::v1::types::view id, bsoncxx::v1::stdx::string_view filename, v1::gridfs::upload_options const &opts={})
Return an uploader for a new file to this bucket.
bucket()
Default initialization.
void upload_from_stream_with_id(bsoncxx::v1::types::view id, bsoncxx::v1::stdx::string_view filename, std::istream &input, v1::gridfs::upload_options const &opts={})
Upload the contents of input as a new file to this bucket.
v1::gridfs::upload_result upload_from_stream(v1::client_session const &session, bsoncxx::v1::stdx::string_view filename, std::istream &input, v1::gridfs::upload_options const &opts={})
Equivalent to upload_from_stream_with_id with a file ID generated using bsoncxx::v1::oid.
static std::error_category const & error_category()
The error category for mongocxx::v1::gridfs::bucket::errc.
Support for downloading files from a GridFS bucket.
Definition downloader.hpp:44
Options related to uploading a file to a GridFS bucket.
Definition upload_options.hpp:48
Result of uploading a file to a GridFS bucket.
Definition upload_result.hpp:42
Support for uploading files to a GridFS bucket.
Definition uploader.hpp:44
Provides mongocxx::v1::find_options.
Provides macros to control the set of symbols exported in the ABI.
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition export.hpp:52
The mongocxx v1 macro guard postlude header.
The mongocxx v1 macro guard prelude header.
The top-level namespace within which all bsoncxx library entities are declared.
Declares entities related to GridFS.
Declares entities whose ABI stability is guaranteed for documented symbols.
The top-level namespace within which all mongocxx library entities are declared.
Provides mongocxx::v1::gridfs::upload_options.
Declares mongocxx::v1::gridfs::upload_result.
Declares mongocxx::v1::client_session.
Declares mongocxx::v1::cursor.
Declares bsoncxx::v1::document::view.
Declares mongocxx::v1::gridfs::bucket.
Declares mongocxx::v1::gridfs::downloader.
Declares mongocxx::v1::gridfs::uploader.
Declares mongocxx::v1::read_concern.
Declares mongocxx::v1::read_preference.
Provides std::optional-related polyfills for library API usage.
Provides std::string_view-related polyfills for library API usage.
Declares non-owning, read-only entities representing a BSON type value.
Declares mongocxx::v1::write_concern.