MongoDB C++ Driver mongocxx-3.0.3
Loading...
Searching...
No Matches
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.
 
const stdx::optional< bool > & allow_disk_use () const
 Retrieves the current allow_disk_use setting.
 
aggregatebatch_size (std::int32_t batch_size)
 Sets the number of documents to return per batch.
 
const stdx::optional< std::int32_t > & batch_size () const
 The current batch size setting.
 
aggregatemax_time (std::chrono::milliseconds max_time)
 Sets the maximum amount of time for this operation to run server-side in milliseconds.
 
const stdx::optional< std::chrono::milliseconds > & max_time () const
 The current max_time setting.
 
aggregateuse_cursor (bool use_cursor)
 Sets whether the results of this aggregation should be returned via a cursor.
 
const stdx::optional< bool > & use_cursor () const
 The current use_cursor setting.
 
aggregateread_preference (class read_preference rp)
 Sets the read_preference for this operation.
 
const stdx::optional< class read_preference > & read_preference () const
 The current read_preference for this operation.
 
aggregatebypass_document_validation (bool bypass_document_validation)
 Sets whether the $out stage should bypass document validation.
 
const stdx::optional< bool > & bypass_document_validation () const
 The current bypass_document_validation setting.
 

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.

◆ 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.

◆ 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.

◆ 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.

◆ 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

◆ 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.

◆ 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
http://docs.mongodb.org/manual/reference/operator/meta/maxTimeMS

◆ 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).
See also
http://docs.mongodb.org/manual/reference/operator/meta/maxTimeMS

◆ 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
http://docs.mongodb.org/manual/core/read-preference/

◆ 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
See also
http://docs.mongodb.org/manual/core/read-preference/

◆ use_cursor() [1/2]

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

The current use_cursor setting.

Returns
the current use_cursor setting

◆ use_cursor() [2/2]

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

Sets whether the results of this aggregation should be returned via a cursor.

Note
The default for this value depends on the version of the server:
  • Servers >= 2.6 will use a server-side default of true.
  • Servers < 2.6 will use a server-side default of false.

If this optional setting is not engaged client-side, the server default will be used.

Parameters
use_cursorwhether or not to use a cursor

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