Mangrove
The C++ Object Document Mapper for MongoDB
Public Member Functions | List of all members
mangrove::current_date_expr< NvpT > Class Template Reference

Creates an expression that uses the $currentDate operator. More...

#include <query_builder.hpp>

Public Member Functions

constexpr current_date_expr (const NvpT &nvp, bool is_date)
 Creates an expression that uses the $currentDate operator with a given field and type. More...
 
void append_to_bson (bsoncxx::builder::core &builder, bool wrap=false) const
 Appends this query to a BSON core builder as an expression '. More...
 

Detailed Description

template<typename NvpT>
class mangrove::current_date_expr< NvpT >

Creates an expression that uses the $currentDate operator.

Constructor & Destructor Documentation

template<typename NvpT >
constexpr mangrove::current_date_expr< NvpT >::current_date_expr ( const NvpT &  nvp,
bool  is_date 
)
inline

Creates an expression that uses the $currentDate operator with a given field and type.

Parameters
nvpThe given field
is_dateWhether the field's type is a date (true) or a timestmap (false)

Member Function Documentation

template<typename NvpT >
void mangrove::current_date_expr< NvpT >::append_to_bson ( bsoncxx::builder::core &  builder,
bool  wrap = false 
) const
inline

Appends this query to a BSON core builder as an expression '.

currentDate
{field: {

type: "timestamp|date"}}'

Parameters
builderA basic BSON core builder.
Whetherto wrap this expression inside a document.

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