#include <mongocxx/v1/gridfs/bucket.hpp>
A GridFS bucket.
Classes | |
| class | options |
| Options for mongocxx::v1::gridfs::bucket. More... | |
Public Types | |
| enum class | errc |
| Errors codes which may be returned by mongocxx::v1::gridfs::bucket. More... | |
Public Member Functions | |
| bucket () | |
| Default initialization. | |
| bucket (bucket &&other) noexcept | |
| Move constructor. | |
| bucket (bucket const &other) | |
| Copy construction. | |
| ~bucket () | |
| Destroy this object. | |
| bsoncxx::v1::stdx::string_view | bucket_name () const |
| Return the name of this bucket. | |
| operator bool () const | |
| Return true when *this is NOT in an assign-or-destroy-only state. | |
| bucket & | operator= (bucket &&other) noexcept |
| Move assignment. | |
| bucket & | operator= (bucket const &other) |
| Copy assignment. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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::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. | |
| 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. | |
| 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. | |
| v1::gridfs::downloader | open_download_stream (bsoncxx::v1::types::view id) |
| Return a downloader for the requested file from this bucket. | |
| 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 | download_to_stream (bsoncxx::v1::types::view id, std::ostream &output) |
| Download the entire contents of the requested file from this bucket into output. | |
| void | download_to_stream (v1::client_session const &session, bsoncxx::v1::types::view id, std::ostream &output) |
| Download the entire contents of the requested file from this bucket into output. | |
| void | download_to_stream (bsoncxx::v1::types::view id, std::ostream &output, std::size_t start, std::size_t end) |
| Partially download the contents of the requested file from this bucket into output. | |
| void | download_to_stream (v1::client_session const &session, bsoncxx::v1::types::view id, std::ostream &output, std::size_t start, std::size_t end) |
| Partially download the contents of the requested file from this bucket into output. | |
| void | delete_file (bsoncxx::v1::types::view id) |
| Delete the requested file from this bucket. | |
| void | delete_file (v1::client_session const &session, bsoncxx::v1::types::view id) |
| Delete the requested file from this bucket. | |
| v1::cursor | find (bsoncxx::v1::document::view filter, v1::find_options const &opts={}) |
| Find files within this bucket matching the given query filter. | |
| v1::cursor | find (v1::client_session const &session, bsoncxx::v1::document::view filter, v1::find_options const &opts={}) |
| Find files within this bucket matching the given query filter. | |
Static Public Member Functions | |
| static std::error_category const & | error_category () |
| The error category for mongocxx::v1::gridfs::bucket::errc. | |
Friends | |
| std::error_code | make_error_code (errc v) |
| Support implicit conversion to std::error_code. | |
|
strong |
Errors codes which may be returned by mongocxx::v1::gridfs::bucket.
| mongocxx::v1::gridfs::bucket::~bucket | ( | ) |
Destroy this object.
|
noexcept |
Move constructor.
| mongocxx::v1::gridfs::bucket::bucket | ( | bucket const & | other | ) |
Copy construction.
| mongocxx::v1::gridfs::bucket::bucket | ( | ) |
Default initialization.
| bsoncxx::v1::stdx::string_view mongocxx::v1::gridfs::bucket::bucket_name | ( | ) | const |
Return the name of this bucket.
| void mongocxx::v1::gridfs::bucket::delete_file | ( | bsoncxx::v1::types::view | id | ) |
Delete the requested file from this bucket.
| mongocxx::v1::exception | with mongocxx::v1::gridfs::bucket::errc::not_found if the requested file does not exist. |
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
| void mongocxx::v1::gridfs::bucket::delete_file | ( | v1::client_session const & | session, |
| bsoncxx::v1::types::view | id ) |
Delete the requested file from this bucket.
| mongocxx::v1::exception | with mongocxx::v1::gridfs::bucket::errc::not_found if the requested file does not exist. |
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
| void mongocxx::v1::gridfs::bucket::download_to_stream | ( | bsoncxx::v1::types::view | id, |
| std::ostream & | output ) |
Download the entire contents of the requested file from this bucket into output.
| mongocxx::v1::exception | with mongocxx::v1::gridfs::bucket::errc::not_found if the requested file does not exist. |
| mongocxx::v1::exception | with mongocxx::v1::gridfs::bucket::errc::corrupt_data if the GridFS file data is invalid or inconsistent. |
| std::ios_base::failure | if an error is encountered when writing to output. |
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
| void mongocxx::v1::gridfs::bucket::download_to_stream | ( | bsoncxx::v1::types::view | id, |
| std::ostream & | output, | ||
| std::size_t | start, | ||
| std::size_t | end ) |
Partially download the contents of the requested file from this bucket into output.
| mongocxx::v1::exception | with mongocxx::v1::gridfs::bucket::errc::not_found if the requested file does not exist. |
| mongocxx::v1::exception | with mongocxx::v1::gridfs::bucket::errc::corrupt_data if the GridFS file data is invalid or inconsistent. |
| std::ios_base::failure | if an error is encountered when writing to output. |
| mongocxx::v1::exception | with mongocxx::v1::gridfs::bucket::errc::invalid_byte_range if [start, end) is not a valid range of byte indexes within the requested file. |
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
| void mongocxx::v1::gridfs::bucket::download_to_stream | ( | v1::client_session const & | session, |
| bsoncxx::v1::types::view | id, | ||
| std::ostream & | output ) |
Download the entire contents of the requested file from this bucket into output.
| mongocxx::v1::exception | with mongocxx::v1::gridfs::bucket::errc::not_found if the requested file does not exist. |
| mongocxx::v1::exception | with mongocxx::v1::gridfs::bucket::errc::corrupt_data if the GridFS file data is invalid or inconsistent. |
| std::ios_base::failure | if an error is encountered when writing to output. |
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
| void mongocxx::v1::gridfs::bucket::download_to_stream | ( | v1::client_session const & | session, |
| bsoncxx::v1::types::view | id, | ||
| std::ostream & | output, | ||
| std::size_t | start, | ||
| std::size_t | end ) |
Partially download the contents of the requested file from this bucket into output.
| mongocxx::v1::exception | with mongocxx::v1::gridfs::bucket::errc::not_found if the requested file does not exist. |
| mongocxx::v1::exception | with mongocxx::v1::gridfs::bucket::errc::corrupt_data if the GridFS file data is invalid or inconsistent. |
| std::ios_base::failure | if an error is encountered when writing to output. |
| mongocxx::v1::exception | with mongocxx::v1::gridfs::bucket::errc::invalid_byte_range if [start, end) is not a valid range of byte indexes within the requested file. |
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
|
static |
The error category for mongocxx::v1::gridfs::bucket::errc.
| v1::cursor mongocxx::v1::gridfs::bucket::find | ( | bsoncxx::v1::document::view | filter, |
| v1::find_options const & | opts = {} ) |
Find files within this bucket matching the given query filter.
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
| v1::cursor mongocxx::v1::gridfs::bucket::find | ( | v1::client_session const & | session, |
| bsoncxx::v1::document::view | filter, | ||
| v1::find_options const & | opts = {} ) |
Find files within this bucket matching the given query filter.
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
| v1::gridfs::downloader mongocxx::v1::gridfs::bucket::open_download_stream | ( | bsoncxx::v1::types::view | id | ) |
Return a downloader for the requested file from this bucket.
| mongocxx::v1::exception | with mongocxx::v1::gridfs::bucket::errc::not_found if the requested file does not exist. |
| mongocxx::v1::exception | with mongocxx::v1::gridfs::bucket::errc::corrupt_data if the GridFS file data is invalid or inconsistent. |
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
| v1::gridfs::downloader mongocxx::v1::gridfs::bucket::open_download_stream | ( | v1::client_session const & | session, |
| bsoncxx::v1::types::view | id ) |
Return a downloader for the requested file from this bucket.
| mongocxx::v1::exception | with mongocxx::v1::gridfs::bucket::errc::not_found if the requested file does not exist. |
| mongocxx::v1::exception | with mongocxx::v1::gridfs::bucket::errc::corrupt_data if the GridFS file data is invalid or inconsistent. |
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
| v1::gridfs::uploader mongocxx::v1::gridfs::bucket::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.
| v1::gridfs::uploader mongocxx::v1::gridfs::bucket::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.
| v1::gridfs::uploader mongocxx::v1::gridfs::bucket::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.
| mongocxx::v1::exception | with mongocxx::v1::gridfs::bucket::errc::invalid_chunk_size_bytes if the "chunkSizeBytes" field is not a positive value. |
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
| v1::gridfs::uploader mongocxx::v1::gridfs::bucket::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.
| mongocxx::v1::exception | with mongocxx::v1::gridfs::bucket::errc::invalid_chunk_size_bytes if the "chunkSizeBytes" field is not a positive value. |
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
|
explicit |
Return true when *this is NOT in an assign-or-destroy-only state.
Move assignment.
| v1::gridfs::upload_result mongocxx::v1::gridfs::bucket::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::upload_result mongocxx::v1::gridfs::bucket::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.
| void mongocxx::v1::gridfs::bucket::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.
| std::ios_base::failure | if an error is encountered when reading from input. |
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
| void mongocxx::v1::gridfs::bucket::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.
| std::ios_base::failure | if an error is encountered when reading from input. |
| mongocxx::v1::server_error | when a server-side error is encountered and a raw server error is available. |
| mongocxx::v1::exception | for all other runtime errors. |
|
friend |
Support implicit conversion to std::error_code.