Loading...
Searching...
No Matches
mongocxx::v_noabi::options::gridfs::bucket Class Reference

`#include <mongocxx/v_noabi/mongocxx/options/gridfs/bucket.hpp>`

## Description

Used by mongocxx::v_noabi::gridfs::bucket.

## Public Member Functions

| bucket ()=default
| Default initialization.
| bucket (v1::gridfs::bucket::options opts)
| Construct with the mongocxx::v1 equivalent.
bsoncxx::v_noabi::stdx::optional< std::string > const & | bucket_name () const
| Gets the name of the bucket.
bucket & | bucket_name (std::string bucket_name)
| Sets the name of the bucket. Defaults to 'fs'.
bsoncxx::v_noabi::stdx::optional< std::int32_t > const & | chunk_size_bytes () const
| Gets the size of the chunks in the bucket.
bucket & | chunk_size_bytes (std::int32_t chunk_size_bytes)
| Sets the size of the chunks in the bucket. This will be used as the chunk size for files uploaded through the bucket without a custom size specified. Defaults to 255KB (255 * 1024).
| operator v1::gridfs::bucket::options () const
| Convert to the mongocxx::v1 equivalent.
bsoncxx::v_noabi::stdx::optional< v_noabi::read_concern > const & | read_concern () const
| Gets the read concern of the bucket.
bucket & | read_concern (v_noabi::read_concern read_concern)
| Sets the read concern to be used when reading from the bucket. Defaults to the read concern of the database containing the bucket's collections.
bsoncxx::v_noabi::stdx::optional< v_noabi::read_preference > const & | read_preference () const
| Gets the read preference of the bucket.
bucket & | read_preference (v_noabi::read_preference read_preference)
| Sets the read preference to be used when reading from the GridFS bucket. Defaults to the read preference of the database containing the bucket's collections.
bsoncxx::v_noabi::stdx::optional< v_noabi::write_concern > const & | write_concern () const
| Gets the write concern of the bucket.
bucket & | write_concern (v_noabi::write_concern write_concern)
| Sets the write concern to be used when writing to the GridFS bucket. Defaults to the write concern of the database containing the bucket's collections.

## Constructor & Destructor Documentation

## bucket() [1/2]

mongocxx::v_noabi::options::gridfs::bucket::bucket | ( |  | ) |

default

Default initialization.

## bucket() [2/2]

mongocxx::v_noabi::options::gridfs::bucket::bucket | ( | v1::gridfs::bucket::options | opts | ) |

Construct with the mongocxx::v1 equivalent.

## Member Function Documentation

## bucket_name() [1/2]

bsoncxx::v_noabi::stdx::optional< std::string > const & mongocxx::v_noabi::options::gridfs::bucket::bucket_name | ( |  | ) | const

inline

Gets the name of the bucket.

Returns
  The name of the bucket.

## bucket_name() [2/2]

bucket & mongocxx::v_noabi::options::gridfs::bucket::bucket_name | ( | std::string | bucket_name | ) |

inline

Sets the name of the bucket. Defaults to 'fs'.

Parameters

  bucket_name | The name of the bucket.

Returns
  A reference to the object on which this member function is being called. This facilitates method chaining.

## chunk_size_bytes() [1/2]

bsoncxx::v_noabi::stdx::optional< std::int32_t > const & mongocxx::v_noabi::options::gridfs::bucket::chunk_size_bytes | ( |  | ) | const

inline

Gets the size of the chunks in the bucket.

Returns
  The size of the chunks in the bucket in bytes.

## chunk_size_bytes() [2/2]

bucket & mongocxx::v_noabi::options::gridfs::bucket::chunk_size_bytes | ( | std::int32_t | chunk_size_bytes | ) |

inline

Sets the size of the chunks in the bucket. This will be used as the chunk size for files uploaded through the bucket without a custom size specified. Defaults to 255KB (255 * 1024).

Parameters

  chunk_size_bytes | The size of the chunks in bytes.

Returns
  A reference to the object on which this member function is being called. This facilitates method chaining.

## operator v1::gridfs::bucket::options()

mongocxx::v_noabi::options::gridfs::bucket::operator v1::gridfs::bucket::options | ( |  | ) | const

inline explicit

Convert to the mongocxx::v1 equivalent.

## read_concern() [1/2]

bsoncxx::v_noabi::stdx::optional< v_noabi::read_concern > const & mongocxx::v_noabi::options::gridfs::bucket::read_concern | ( |  | ) | const

inline

Gets the read concern of the bucket.

Returns
  The read concern of the bucket.

## read_concern() [2/2]

bucket & mongocxx::v_noabi::options::gridfs::bucket::read_concern | ( | v_noabi::read_concern | read_concern | ) |

inline

Sets the read concern to be used when reading from the bucket. Defaults to the read concern of the database containing the bucket's collections.

Parameters

  read_concern | The read concern of the bucket.

Returns
  A reference to the object on which this member function is being called. This facilitates method chaining.

## read_preference() [1/2]

bsoncxx::v_noabi::stdx::optional< v_noabi::read_preference > const & mongocxx::v_noabi::options::gridfs::bucket::read_preference | ( |  | ) | const

inline

Gets the read preference of the bucket.

Returns
  The read preference of the bucket.

## read_preference() [2/2]

bucket & mongocxx::v_noabi::options::gridfs::bucket::read_preference | ( | v_noabi::read_preference | read_preference | ) |

inline

Sets the read preference to be used when reading from the GridFS bucket. Defaults to the read preference of the database containing the bucket's collections.

Note
  Because many GridFS operations require multiple independent reads from separate collections, use with secondaries is strongly discouraged because reads could go to different secondaries, resulting in inconsistent data if all file and chunk documents have not replicated to all secondaries.

Parameters

  read_preference | The read preference of the GridFS bucket.

Returns
  A reference to the object on which this member function is being called. This facilitates method chaining.

## write_concern() [1/2]

bsoncxx::v_noabi::stdx::optional< v_noabi::write_concern > const & mongocxx::v_noabi::options::gridfs::bucket::write_concern | ( |  | ) | const

inline

Gets the write concern of the bucket.

Returns
  The write concern of the bucket.

## write_concern() [2/2]

bucket & mongocxx::v_noabi::options::gridfs::bucket::write_concern | ( | v_noabi::write_concern | write_concern | ) |

inline

Sets the write concern to be used when writing to the GridFS bucket. Defaults to the write concern of the database containing the bucket's collections.

Parameters

  write_concern | The write concern of the GridFS bucket.

Returns
  A reference to the object on which this member function is being called. This facilitates method chaining.

The documentation for this class was generated from the following file:

- mongocxx/v_noabi/mongocxx/options/gridfs/bucket.hpp