/** * Parses an array contains or array match expression from the given object * node */ public static ArrayComparisonExpression fromJson(ObjectNode node) { JsonNode x = node.get("contains"); if (x != null) { return ArrayContainsExpression.fromJson(node); } else { x = node.get("elemMatch"); if (x != null) { return ArrayMatchExpression.fromJson(node); } } throw Error.get(QueryConstants.ERR_INVALID_ARRAY_COMPARISON_EXPRESSION, node.toString()); } }
/** * Parses an array contains or array match expression from the given object * node */ public static ArrayComparisonExpression fromJson(ObjectNode node) { JsonNode x = node.get("contains"); if (x != null) { return ArrayContainsExpression.fromJson(node); } else { x = node.get("elemMatch"); if (x != null) { return ArrayMatchExpression.fromJson(node); } } throw Error.get(QueryConstants.ERR_INVALID_ARRAY_COMPARISON_EXPRESSION, node.toString()); } }