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

This represents a boolean expression with two arguments. More...

#include <query_builder.hpp>

Public Member Functions

constexpr boolean_expr (const Expr1 &lhs, const Expr2 &rhs, const char *op)
 Constructs a boolean expression from two other 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: [{lhs}, {rhs}] }".
 

Detailed Description

template<typename Expr1, typename Expr2>
class mangrove::boolean_expr< Expr1, Expr2 >

This represents a boolean expression with two arguments.

The arguments can, in turn, be boolean expressions.

Constructor & Destructor Documentation

template<typename Expr1 , typename Expr2 >
constexpr mangrove::boolean_expr< Expr1, Expr2 >::boolean_expr ( const Expr1 &  lhs,
const Expr2 &  rhs,
const char *  op 
)
inline

Constructs a boolean expression from two other expressions, and a certain operator.

Parameters
lhsThe left-hand side of the expression.
rhsThe right-hand side of the expression.
opThe operator of the expression, e.g. AND or OR.

Member Function Documentation

template<typename Expr1 , typename Expr2 >
void mangrove::boolean_expr< Expr1, Expr2 >::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.
Whetherto wrap this expression inside a document.

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