* Adding elemMatch and nor * lint * adding test * adding edge test * postgres support * clean up * empty test
This commit is contained in:
committed by
Diamond Lewis
parent
ad244d6654
commit
c0f86ae1d1
@@ -290,6 +290,9 @@ function transformQueryKeyValue(className, key, value, schema) {
|
||||
if (transformedConstraint.$text) {
|
||||
return {key: '$text', value: transformedConstraint.$text};
|
||||
}
|
||||
if (transformedConstraint.$elemMatch) {
|
||||
return { key: '$nor', value: [{ [key]: transformedConstraint }] };
|
||||
}
|
||||
return {key, value: transformedConstraint};
|
||||
}
|
||||
|
||||
@@ -797,6 +800,19 @@ function transformConstraint(constraint, field) {
|
||||
answer[key] = s;
|
||||
break;
|
||||
|
||||
case '$containedBy': {
|
||||
const arr = constraint[key];
|
||||
if (!(arr instanceof Array)) {
|
||||
throw new Parse.Error(
|
||||
Parse.Error.INVALID_JSON,
|
||||
`bad $containedBy: should be an array`
|
||||
);
|
||||
}
|
||||
answer.$elemMatch = {
|
||||
$nin: arr.map(transformer)
|
||||
};
|
||||
break;
|
||||
}
|
||||
case '$options':
|
||||
answer[key] = constraint[key];
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user