20 #include "mongo/bson/bsonobj.h"
61 BSONFieldValue(
const std::string& name,
const T& t) : _name(name), _t(t) {}
63 const T& value()
const {
66 const std::string& name()
const {
78 BSONField(
const std::string& name) : _name(name), _defaultSet(
false) {}
80 BSONField(
const std::string& name,
const T& defaultVal)
81 : _name(name), _default(defaultVal), _defaultSet(
true) {}
91 const std::string& name()
const {
95 const T& getDefault()
const {
99 bool hasDefault()
const {
103 std::string operator()()
const {
110 return query(
"$gt", t);
114 return query(
"$lt", t);
118 return query(
"$ne", t);
Definition: bson_field.h:76
Utility functions for parsing numbers from strings.
Definition: compare_numbers.h:20
A BSONField holds the name and the type intended for a given BSON element.
Definition: bson_field.h:59