MCPcopy
hub / github.com/parse-community/parse-server / matchesQuery

Function matchesQuery

src/LiveQuery/QueryTools.js:171–185  ·  view source on GitHub ↗

* matchesQuery -- Determines if an object would be returned by a Parse Query * It's a lightweight, where-clause only implementation of a full query engine. * Since we find queries that match objects, rather than objects that match * queries, we can avoid building a full-blown query tool.

(object: any, query: any)

Source from the content-addressed store, hash-verified

169 * queries, we can avoid building a full-blown query tool.
170 */
171function matchesQuery(object: any, query: any): boolean {
172 if (query instanceof Parse.Query) {
173 var className = object.id instanceof Id ? object.id.className : object.className;
174 if (className !== query.className) {
175 return false;
176 }
177 return matchesQuery(object, query._where);
178 }
179 for (var field in query) {
180 if (!matchesKeyConstraints(object, field, query[field])) {
181 return false;
182 }
183 }
184 return true;
185}
186
187function equalObjectsGeneric(obj, compareTo, eqlFn) {
188 if (Array.isArray(obj)) {

Callers 4

_matchesSubscriptionMethod · 0.90
matchesKeyConstraintsFunction · 0.85
QueryTools.spec.jsFile · 0.85

Calls 1

matchesKeyConstraintsFunction · 0.85

Tested by

no test coverage detected