MongoDB C++ Driver  mongocxx-3.0.2
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...
 
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...
 
aggregateuse_cursor (bool use_cursor)
 Sets whether the results of this aggregation should be returned via a cursor. More...
 
const stdx::optional< bool > & use_cursor () const
 The current use_cursor 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...
 

Detailed Description

Class representing the optional arguments to a MongoDB aggregation operation.

Member Function Documentation

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.
const stdx::optional<bool>& mongocxx::options::aggregate::allow_disk_use ( ) const

Retrieves the current allow_disk_use setting.

Returns
Whether disk use is allowed.
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.
const stdx::optional<std::int32_t>& mongocxx::options::aggregate::batch_size ( ) const

The current batch size setting.

Returns
The current batch size.
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.
const stdx::optional<bool>& mongocxx::options::aggregate::bypass_document_validation ( ) const

The current bypass_document_validation setting.

Returns
the current bypass_document_validation setting
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
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
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/
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/
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
const stdx::optional<bool>& mongocxx::options::aggregate::use_cursor ( ) const

The current use_cursor setting.

Returns
the current use_cursor setting

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