| 52 | struct ExtValueOperatorNin { |
| 53 | static const char* name; |
| 54 | static Reference<IPredicate> toPredicate(std::string const& unencoded_path, bson::BSONElement const& element) { |
| 55 | std::vector<Reference<IPredicate>> terms; |
| 56 | // We can do this *despite* Mongo array semantics, because those semantics inconsistently treat a |
| 57 | // $ne like a $not: {path: {$in: element}}. |
| 58 | for (auto it = element.Obj().begin(); it.more();) { |
| 59 | auto el = it.next(); |
| 60 | terms.push_back(ref(new NotPredicate(eq_predicate(el, unencoded_path)))); |
| 61 | } |
| 62 | return ref(new AndPredicate(terms)); |
| 63 | } |
| 64 | }; |
| 65 | REGISTER_VALUE_OPERATOR(ExtValueOperatorNin, "$nin"); |
| 66 |
nothing calls this directly
no test coverage detected