![]() |
Mangrove
The C++ Object Document Mapper for MongoDB
|
This represents an expression with the $not operator, which wraps a comparison expression and negates it. More...
#include <query_builder.hpp>
Public Member Functions | |
constexpr | not_expr (const Expr &expr) |
Creates a $not expression that negates the given comparison expression. More... | |
std::string & | append_name (std::string &s) const |
Appends the name of the contained field to a string. | |
void | append_to_bson (bsoncxx::builder::core &builder, bool wrap=false, bool omit_name=false) const |
Appends this expression to a BSON core builder, as a key-value pair of the form "key: {$not: {$cmp: val}}". More... | |
operator bsoncxx::document::view_or_value () const | |
Converts the expression to a BSON filter for a query. More... | |
This represents an expression with the $not operator, which wraps a comparison expression and negates it.
|
inline |
Creates a $not expression that negates the given comparison expression.
expr | A comparison expression |
|
inline |
Appends this expression to a BSON core builder, as a key-value pair of the form "key: {$not: {$cmp: val}}".
builder | a BSON core builder |
wrap | Whether to wrap the BSON inside a document. |
omit_name | Whether to skip the name of the field. This is used primarily in $elemMatch queries with scalar arrays, so one can have a query like {array: { |
not: {$gt: 5}}}}
|
inline |
Converts the expression to a BSON filter for a query.
The resulting BSON is of the form "{key: {$cmp: val}}".