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

Class representing the optional arguments to a MongoDB aggregation operation. More...

#include <aggregate.hpp>

Public Member Functions

aggregateallow_disk_use (bool allow_disk_use)
 Enables writing to temporary files. More...
 
const stdx::optional< bool > & allow_disk_use () const
 Retrieves the current allow_disk_use setting. More...
 
aggregatebatch_size (std::int32_t batch_size)
 Sets the number of documents to return per batch. More...
 
const stdx::optional< std::int32_t > & batch_size () const
 The current batch size setting. More...
 
aggregatecollation (bsoncxx::document::view_or_value collation)
 Sets the collation for this operation. More...
 
const stdx::optional< bsoncxx::document::view_or_value > & collation () const
 Retrieves the current collation for this operation. More...
 
aggregatelet (bsoncxx::document::view_or_value let)
 Sets the variable mapping for this operation. More...
 
const stdx::optional< bsoncxx::document::view_or_value > & let () const
 Retrieves the current variable mapping for this operation. More...
 
aggregatemax_time (std::chrono::milliseconds max_time)
 Sets the maximum amount of time for this operation to run server-side in milliseconds. More...
 
const stdx::optional< std::chrono::milliseconds > & max_time () const
 The current max_time setting. More...
 
aggregateread_preference (class read_preference rp)
 Sets the read_preference for this operation. More...
 
const stdx::optional< class read_preference > & read_preference () const
 The current read_preference for this operation. More...
 
aggregatebypass_document_validation (bool bypass_document_validation)
 Sets whether the $out stage should bypass document validation. More...
 
const stdx::optional< bool > & bypass_document_validation () const
 The current bypass_document_validation setting. More...
 
aggregatehint (class hint index_hint)
 Sets the index to use for this operation. More...
 
const stdx::optional< class hint > & hint () const
 Gets the current hint. More...
 
aggregatewrite_concern (class write_concern write_concern)
 Sets the write concern to use for this operation. More...
 
const stdx::optional< class write_concern > & write_concern () const
 Gets the current write concern. More...
 
aggregateread_concern (class read_concern read_concern)
 Sets the read concern to use for this operation. More...
 
const stdx::optional< class read_concern > & read_concern () const
 Gets the current read concern. More...
 
aggregatecomment (bsoncxx::types::bson_value::view_or_value comment)
 Sets the comment to use for this operation. More...
 
const stdx::optional< bsoncxx::types::bson_value::view_or_value > & comment () const
 Gets the current comment. More...
 

Detailed Description

Class representing the optional arguments to a MongoDB aggregation operation.

Member Function Documentation

◆ allow_disk_use() [1/2]

const stdx::optional<bool>& mongocxx::options::aggregate::allow_disk_use ( ) const

Retrieves the current allow_disk_use setting.

Returns
Whether disk use is allowed.
See also
https://docs.mongodb.com/manual/reference/command/aggregate/

◆ allow_disk_use() [2/2]

aggregate& mongocxx::options::aggregate::allow_disk_use ( bool  allow_disk_use)

Enables writing to temporary files.

When set to true, aggregation stages can write data to the _tmp subdirectory in the dbPath directory. The server-side default is false.

Parameters
allow_disk_useWhether or not to allow disk use.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.
See also
https://docs.mongodb.com/manual/reference/command/aggregate/

◆ batch_size() [1/2]

const stdx::optional<std::int32_t>& mongocxx::options::aggregate::batch_size ( ) const

The current batch size setting.

Returns
The current batch size.
See also
https://docs.mongodb.com/manual/reference/command/aggregate/

◆ batch_size() [2/2]

aggregate& mongocxx::options::aggregate::batch_size ( std::int32_t  batch_size)

Sets the number of documents to return per batch.

Parameters
batch_sizeThe size of the batches to request.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.
See also
https://docs.mongodb.com/manual/reference/command/aggregate/

◆ bypass_document_validation() [1/2]

const stdx::optional<bool>& mongocxx::options::aggregate::bypass_document_validation ( ) const

The current bypass_document_validation setting.

Returns
the current bypass_document_validation setting
See also
https://docs.mongodb.com/manual/reference/command/aggregate/

◆ bypass_document_validation() [2/2]

aggregate& mongocxx::options::aggregate::bypass_document_validation ( bool  bypass_document_validation)

Sets whether the $out stage should bypass document validation.

Parameters
bypass_document_validationwhether or not to bypass validation.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.

◆ collation() [1/2]

const stdx::optional<bsoncxx::document::view_or_value>& mongocxx::options::aggregate::collation ( ) const

Retrieves the current collation for this operation.

Returns
The current collation.
See also
https://docs.mongodb.com/manual/reference/command/aggregate/

◆ collation() [2/2]

aggregate& mongocxx::options::aggregate::collation ( bsoncxx::document::view_or_value  collation)

Sets the collation for this operation.

Parameters
collationThe new collation.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.
See also
https://docs.mongodb.com/manual/reference/command/aggregate/

◆ comment() [1/2]

const stdx::optional<bsoncxx::types::bson_value::view_or_value>& mongocxx::options::aggregate::comment ( ) const

Gets the current comment.

Returns
The current comment, if it is set.
See also
https://docs.mongodb.com/manual/reference/command/aggregate/

◆ comment() [2/2]

aggregate& mongocxx::options::aggregate::comment ( bsoncxx::types::bson_value::view_or_value  comment)

Sets the comment to use for this operation.

See also
https://docs.mongodb.com/manual/reference/command/aggregate/
Parameters
commentObject representing the comment.
Returns
A reference to the object on which this member function is being called.

◆ hint() [1/2]

const stdx::optional<class hint>& mongocxx::options::aggregate::hint ( ) const

Gets the current hint.

Returns
The current hint, if one is set.
See also
https://docs.mongodb.com/manual/reference/command/aggregate/

◆ hint() [2/2]

aggregate& mongocxx::options::aggregate::hint ( class hint  index_hint)

Sets the index to use for this operation.

See also
https://docs.mongodb.com/manual/reference/command/aggregate/
Note
if the server already has a cached shape for this query, it may ignore a hint.
Parameters
index_hintObject representing the index to use.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.

◆ let() [1/2]

const stdx::optional<bsoncxx::document::view_or_value>& mongocxx::options::aggregate::let ( ) const

Retrieves the current variable mapping for this operation.

Returns
The current variable mapping.
See also
https://docs.mongodb.com/manual/reference/command/aggregate/

◆ let() [2/2]

aggregate& mongocxx::options::aggregate::let ( bsoncxx::document::view_or_value  let)

Sets the variable mapping for this operation.

Parameters
letThe new variable mapping.
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.
See also
https://docs.mongodb.com/manual/reference/command/aggregate/

◆ max_time() [1/2]

const stdx::optional<std::chrono::milliseconds>& mongocxx::options::aggregate::max_time ( ) const

The current max_time setting.

Returns
The current max time (in milliseconds).
See also
https://docs.mongodb.com/manual/reference/command/aggregate/

◆ max_time() [2/2]

aggregate& mongocxx::options::aggregate::max_time ( std::chrono::milliseconds  max_time)

Sets the maximum amount of time for this operation to run server-side in milliseconds.

Parameters
max_timeThe max amount of time (in milliseconds).
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.
See also
https://docs.mongodb.com/manual/reference/command/aggregate/

◆ read_concern() [1/2]

const stdx::optional<class read_concern>& mongocxx::options::aggregate::read_concern ( ) const

Gets the current read concern.

Returns
The current read concern, if it is set.
See also
https://docs.mongodb.com/manual/reference/command/aggregate/

◆ read_concern() [2/2]

aggregate& mongocxx::options::aggregate::read_concern ( class read_concern  read_concern)

Sets the read concern to use for this operation.

See also
https://docs.mongodb.com/manual/reference/command/aggregate/
Parameters
read_concernObject representing the read_concern.
Returns
A reference to the object on which this member function is being called.

◆ read_preference() [1/2]

const stdx::optional<class read_preference>& mongocxx::options::aggregate::read_preference ( ) const

The current read_preference for this operation.

Returns
the current read_preference
See also
https://docs.mongodb.com/manual/reference/command/aggregate/

◆ read_preference() [2/2]

aggregate& mongocxx::options::aggregate::read_preference ( class read_preference  rp)

Sets the read_preference for this operation.

Parameters
rpthe new read_preference
Returns
A reference to the object on which this member function is being called. This facilitates method chaining.
See also
https://docs.mongodb.com/manual/reference/command/aggregate/

◆ write_concern() [1/2]

const stdx::optional<class write_concern>& mongocxx::options::aggregate::write_concern ( ) const

Gets the current write concern.

Returns
The current write concern, if it is set.
See also
https://docs.mongodb.com/manual/reference/command/aggregate/

◆ write_concern() [2/2]

aggregate& mongocxx::options::aggregate::write_concern ( class write_concern  write_concern)

Sets the write concern to use for this operation.

Only has an effect if $out is a part of the pipeline.

See also
https://docs.mongodb.com/manual/reference/command/aggregate/
Parameters
write_concernObject representing the write_concern.
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: