MongoDB C++ Driver  mongocxx-3.7.0
Public Member Functions | List of all members
mongocxx::options::gridfs::upload Class Reference

Class representing the optional arguments to a MongoDB GridFS upload operation. More...

#include <upload.hpp>

Public Member Functions

uploadchunk_size_bytes (std::int32_t chunk_size_bytes)
 Sets the chunk size of the GridFS file being uploaded. More...
 
const stdx::optional< std::int32_t > & chunk_size_bytes () const
 Gets the chunk size of the GridFS file being uploaded. More...
 
uploadmetadata (bsoncxx::document::view_or_value metadata)
 Sets the metadata field of the GridFS file being uploaded. More...
 
const stdx::optional< bsoncxx::document::view_or_value > & metadata () const
 Gets the metadata of the GridFS file being uploaded. More...
 

Detailed Description

Class representing the optional arguments to a MongoDB GridFS upload operation.

Member Function Documentation

◆ chunk_size_bytes() [1/2]

const stdx::optional<std::int32_t>& mongocxx::options::gridfs::upload::chunk_size_bytes ( ) const

Gets the chunk size of the GridFS file being uploaded.

Returns
The chunk size of the GridFS file being uploaded in bytes.

◆ chunk_size_bytes() [2/2]

upload& mongocxx::options::gridfs::upload::chunk_size_bytes ( std::int32_t  chunk_size_bytes)

Sets the chunk size of the GridFS file being uploaded.

Defaults to the chunk size specified in options::gridfs::bucket.

Parameters
chunk_size_bytesThe size of the chunks in bytes.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.

◆ metadata() [1/2]

const stdx::optional<bsoncxx::document::view_or_value>& mongocxx::options::gridfs::upload::metadata ( ) const

Gets the metadata of the GridFS file being uploaded.

Returns
The metadata document of the GridFS file.

◆ metadata() [2/2]

upload& mongocxx::options::gridfs::upload::metadata ( bsoncxx::document::view_or_value  metadata)

Sets the metadata field of the GridFS file being uploaded.

A GridFS file can store arbitrary metadata in the form of a BSON document.

Parameters
metadataThe metadata document for the GridFS file.
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: