/** * Perform a bit operation on the given field * * @param field The field to perform the operation on * @param operation The operation to perform * @param value The value * @return this object */ public Builder bit(String field, String operation, int value) { return addOperation("$bit", field, new BasicDBObject(operation, value)); }
/** * Add the given values to the array value if they don't already exist in the specified field atomically * * @param field The field to add the values to * @param values The values to add * @return this object */ public Builder addToSet(String field, List<?> values) { return addOperation("$addToSet", field, new BasicDBObject("$each", values)); }
/** * Perform a bit operation on the given field * * @param field The field to perform the operation on * @param operation The operation to perform * @param value The value * @return this object */ public Builder bit(String field, String operation, int value) { return addOperation("$bit", field, new BasicDBObject(operation, value)); }
/** * Remove all occurances of the values from the array at field * * @param field The field to remove the values from * @param values The values to remove * @return this object */ public Builder pullAll(String field, Object... values) { return addOperation("$pullAll", field, values); }
/** * Add the given value to the array value at the specified field atomically * * @param field The field to add the value to * @param value The value to add * @return this object */ public Builder push(String field, Object value) { return addOperation("$push", field, value); }
/** * Set the given field (can be multiple levels deep) to the given value atomically * * @param field The field to set * @param value The value to set it to * @return this object */ public Builder set(String field, Object value) { return addOperation("$set", field, value); }
/** * Remove the first value from the array specified by field atomically * * @param field The field to remove the value from * @return this object */ public Builder popFirst(String field) { return addOperation("$pop", field, -1); }
/** * Add the given values to the array value if they don't already exist in the specified field atomically * * @param field The field to add the values to * @param values The values to add * @return this object */ public Builder addToSet(String field, Object... values) { return addOperation("$addToSet", field, new BasicDBObject("$each", values)); }
/** * Add all of the given values to the array value at the specified field atomically * * @param field The field to add the values to * @param values The values to add * @return this object */ public Builder pushAll(String field, List<?> values) { return addOperation("$pushAll", field, values); }
/** * Add all of the given values to the array value at the specified field atomically * * @param field The field to add the values to * @param values The values to add * @return this object */ public Builder pushAll(String field, Object... values) { return addOperation("$pushAll", field, values); }
/** * Remove all occurances of the values from the array at field * * @param field The field to remove the values from * @param values The values to remove * @return this object */ public Builder pullAll(String field, List<?> values) { return addOperation("$pullAll", field, values); }
/** * Remove all occurances of the values from the array at field * * @param field The field to remove the values from * @param values The values to remove * @return this object */ public Builder pullAll(String field, Object... values) { return addOperation("$pullAll", field, values); }
/** * Remove the last value from the array specified by field atomically * * @param field The field to remove the value from * @return this object */ public Builder popLast(String field) { return addOperation("$pop", field, 1); }
/** * Unset the given field atomically * * @param field The field to unset * @return this object */ public Builder unset(String field) { return addOperation("$unset", field, 1); }
/** * Remove the last value from the array specified by field atomically * * @param field The field to remove the value from * @return this object */ public Builder popLast(String field) { return addOperation("$pop", field, 1); }
/** * Set the given field (can be multiple levels deep) to the given value atomically * * @param field The field to set * @param value The value to set it to * @return this object */ public Builder set(String field, Object value) { return addOperation("$set", field, value); }
/** * Increment the given field atomically by the given value * * @param field The field to increment * @param by The value to increment by * @return this object */ public Builder inc(String field, int by) { return addOperation("$inc", field, by); }
/** * Add all of the given values to the array value at the specified field atomically * * @param field The field to add the values to * @param values The values to add * @return this object */ public Builder pushAll(String field, List<?> values) { return addOperation("$pushAll", field, values); }
/** * Remove the first value from the array specified by field atomically * * @param field The field to remove the value from * @return this object */ public Builder popFirst(String field) { return addOperation("$pop", field, -1); }
/** * Add the given value to the array value at the specified field atomically * * @param field The field to add the value to * @param value The value to add * @return this object */ public Builder push(String field, Object value) { return addOperation("$push", field, value); }