| 171 | struct ExtValueOperatorAll { |
| 172 | static const char* name; |
| 173 | static Reference<IPredicate> toPredicate(std::string const& unencoded_path, bson::BSONElement const& element) { |
| 174 | std::vector<Reference<IPredicate>> terms; |
| 175 | if (element.Array().size() == 0) { |
| 176 | return ref(new NonePredicate()); |
| 177 | } else { |
| 178 | for (auto e : element.Array()) { |
| 179 | if (e.isABSONObj() && e.Obj().hasField("$elemMatch")) { |
| 180 | terms.push_back(valueQueryToPredicate(e.Obj(), unencoded_path)); |
| 181 | } else { |
| 182 | terms.push_back(eq_predicate(e, unencoded_path)); |
| 183 | } |
| 184 | } |
| 185 | return ref(new AndPredicate(terms)); |
| 186 | } |
| 187 | } |
| 188 | }; |
| 189 | REGISTER_VALUE_OPERATOR(ExtValueOperatorAll, "$all"); |
| 190 |
nothing calls this directly
no test coverage detected