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

This class represents a boolean expression over an array of arguments. More...

#include <query_builder.hpp>

Public Member Functions

constexpr boolean_list_expr (const List args, const char *op)
 Constructs a boolean expression from a list of sub-expressions, and a certain operator. More...
 
void append_to_bson (bsoncxx::builder::core &builder, bool wrap=false) const
 Appends this query to a BSON core builder as a key-value pair "$op: [{lhs}, {rhs}]". More...
 
 operator bsoncxx::document::view_or_value () const
 Converts the expression to a BSON filter for a query, in the form "{$op: [{arg1}, {arg2}, ...]}".
 

Detailed Description

template<typename List>
class mangrove::boolean_list_expr< List >

This class represents a boolean expression over an array of arguments.

This is particularly useful for the $nor operator. When converted to BSON, this class produces an expression {$op: [{arg1}, {arg2}, ...]}

Constructor & Destructor Documentation

template<typename List >
constexpr mangrove::boolean_list_expr< List >::boolean_list_expr ( const List  args,
const char *  op 
)
inline

Constructs a boolean expression from a list of sub-expressions, and a certain operator.

Parameters
argsAn expression list of boolean conditions.
opThe operator of the expression, e.g. AND or OR.

Member Function Documentation

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

Appends this query to a BSON core builder as a key-value pair "$op: [{lhs}, {rhs}]".

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

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