/** * The field, modulo the given mod argument, is equal to the value * * @param field The field to compare * @param mod The modulo * @param value The value to compare to * @return the query */ public Q mod(String field, Number mod, Number value) { return put(field, QueryOperators.MOD, Arrays.asList(mod, value)); }
/** * The field, modulo the given mod argument, is equal to the value * * @param field The field to compare * @param mod The modulo * @param value The value to compare to * @return the query */ public Q mod(String field, Number mod, Number value) { return put(field, QueryOperators.MOD, Arrays.asList(mod, value)); }
/** * The given field matches the regular expression * * @param field The field to comare * @param regex The regular expression to match with * @return the query */ public Q regex(String field, Pattern regex) { return put(field, null, regex); }
/** * The given field exists * * @param field The field to check * @return the query */ public Q exists(String field) { return put(field, QueryOperators.EXISTS, true); }
/** * The array field is of the given size * * @param field The field to compare * @param size The value to compare * @return the query */ public Q size(String field, int size) { return put(field, QueryOperators.SIZE, size); }
/** * The array field contains all of the given values * * @param field The field to compare * @param values The values to compare to * @return the query */ public Q all(String field, Collection<?> values) { return put(field, QueryOperators.ALL, values); }
/** * The field is less than or equal to the given value * * @param field The field to compare * @param value The value to compare to * @return the query */ public Q lessThanEquals(String field, Object value) { return put(field, QueryOperators.LTE, value); }
/** * The given field doesn't exist * * @param field The field to check * @return the query */ public Q notExists(String field) { return put(field, QueryOperators.EXISTS, false); }
/** * The field is greater than the given value * * @param field The field to compare * @param value The value to compare to * @return the query */ public Q greaterThan(String field, Object value) { return put(field, QueryOperators.GT, value); }
/** * The field is equal to the given value * * @param field The field to compare * @param value The value to compare to * @return the query */ public Q is(String field, Object value) { return put(field, null, value); }
@Override protected DBCursor<T> put(String field, String op, Object value) { checkExecuted(); return super.put(field, op, jacksonDBCollection.serializeField(value)); }
/** * The field is not in the given set of values * * @param field The field to compare * @param values The value to compare to * @return the query */ public Q notIn(String field, Collection<?> values) { return put(field, QueryOperators.NIN, values); }
/** * The field is not in the given set of values * * @param field The field to compare * @param values The value to compare to * @return the query */ public Q notIn(String field, Object... values) { return put(field, QueryOperators.NIN, values); }
/** * An element in the given array field matches the given query * * @param field the array field * @param query The query to attempt to match against the elements of the array field * @return the query */ public Q elemMatch(String field, Query query) { return put(field, "$elemMatch", query); }
/** * The field is in the given set of values * * @param field The field to compare * @param values The value to compare to * @return the query */ public Q in(String field, Collection<?> values) { return put(field, QueryOperators.IN, values); }
/** * The field is not equal to the given value * * @param field The field to compare * @param value The value to compare to * @return the query */ public Q notEquals(String field, Object value) { return put(field, QueryOperators.NE, value); }
/** * The array field contains all of the given values * * @param field The field to compare * @param values The values to compare to * @return the query */ public Q all(String field, Collection<?> values) { return put(field, QueryOperators.ALL, values); }
/** * Execute the given JavaScript code as part of the query * * @param code the JavaScript code * @return the query */ public Q where(String code) { return put("$where", null, code); }
/** * The array field contains all of the given values * * @param field The field to compare * @param values The values to compare to * @return the query */ public Q all(String field, Object... values) { return put(field, QueryOperators.ALL, values); }
/** * The field is greater than or equal to the given value * * @param field The field to compare * @param value The value to compare to * @return the query */ public Q greaterThanEquals(String field, Object value) { return put(field, QueryOperators.GTE, value); }