public class ConditionBuilder extends Object implements DocumentAssignable
Use the QueryBuilder.where(String)
method to create a
ConditionBuilder
.
QueryBuilder.whereField(String)
Modifier | Constructor and Description |
---|---|
protected |
ConditionBuilder(String fieldName,
QueryBuilder parent)
Creates a new ConditionBuilder.
|
Modifier and Type | Method and Description |
---|---|
ConditionBuilder |
after(Date dateTime)
Checks if the value is greater than the specified dateTime.
|
ConditionBuilder |
all(ArrayBuilder elements)
Specify the values that must all be in the fields array.
|
ConditionBuilder |
all(boolean... values)
Specify the values that must all be in the fields array.
|
ConditionBuilder |
all(byte[]... values)
Specify the values that must all be in the fields array.
|
ConditionBuilder |
all(Constant... values)
Specify the values that must all be in the fields array.
|
ConditionBuilder |
all(Date... values)
Specify the values that must all be in the fields array.
|
ConditionBuilder |
all(DocumentAssignable... values)
Specify the values that must all be in the fields array.
|
ConditionBuilder |
all(Double... values)
Specify the values that must all be in the fields array.
|
ConditionBuilder |
all(Element... elements)
Specify the values that must all be in the fields array.
|
ConditionBuilder |
all(Integer... values)
Specify the values that must all be in the fields array.
|
ConditionBuilder |
all(Long... values)
Specify the values that must all be in the fields array.
|
ConditionBuilder |
all(ObjectId... values)
Specify the values that must all be in the fields array.
|
ConditionBuilder |
all(Pattern... values)
Specify the values that must all be in the fields array.
|
ConditionBuilder |
all(String... values)
Specify the values that must all be in the fields array.
|
ConditionBuilder |
all(UUID... values)
Specify the values that must all be in the fields array.
|
ConditionBuilder |
and(String fieldName)
Starts a logical conjunction with this condition builder.
|
Document |
asDocument()
Converts the object into a document.
|
ConditionBuilder |
before(Date dateTime)
Checks if the value is less than the specified dateTime.
|
Document |
build()
Returns the results of building the parent
QueryBuilder . |
ConditionBuilder |
comment(String comment)
Adds a
$comment to the query. |
ConditionBuilder |
elementMatches(DocumentAssignable arrayElementQuery)
Query to match a single element in the array field.
|
ConditionBuilder |
equals(boolean value)
Checks if the value equals the specified value.
|
ConditionBuilder |
equals(byte[] value)
Checks if the value equals the specified value.
|
ConditionBuilder |
equals(byte subType,
byte[] value)
Checks if the value equals the specified value.
|
ConditionBuilder |
equals(Date dateTime)
Checks if the value equals the specified dateTime.
|
ConditionBuilder |
equals(DocumentAssignable value)
Checks if the value equals the specified value.
|
ConditionBuilder |
equals(double value)
Checks if the value equals the specified value.
|
ConditionBuilder |
equals(int value)
Checks if the value equals the specified value.
|
ConditionBuilder |
equals(long value)
Checks if the value equals the specified value.
|
ConditionBuilder |
equals(ObjectId value)
Checks if the value equals the specified value.
|
ConditionBuilder |
equals(Pattern value)
Checks if the value equals the specified value.
|
ConditionBuilder |
equals(String value)
Checks if the value equals the specified value.
|
ConditionBuilder |
equals(UUID uuid)
Checks if the value equals the specified uuid using the standard
byte ordering.
|
ConditionBuilder |
equalsJavaScript(String value)
Checks if the value equals the specified value.
|
ConditionBuilder |
equalsJavaScript(String value,
DocumentAssignable scope)
Checks if the value equals the specified value.
|
ConditionBuilder |
equalsLegacy(UUID uuid)
Checks if the value equals the specified value using the legacy
Java byte ordering.
|
ConditionBuilder |
equalsMaxKey()
Checks if the value is a max key element.
|
ConditionBuilder |
equalsMinKey()
Checks if the value is a min key element.
|
ConditionBuilder |
equalsMongoTimestamp(long value)
Checks if the value equals the specified value.
|
ConditionBuilder |
equalsNull()
Checks if the value is a null value.
|
ConditionBuilder |
equalsSymbol(String value)
Checks if the value equals the specified value.
|
ConditionBuilder |
equalsTimestamp(long value)
Checks if the value equals the specified value.
|
ConditionBuilder |
exists()
Checks if the field exists (or not) in the document.
|
ConditionBuilder |
exists(boolean value)
Checks if the field exists (or not) in the document.
|
ConditionBuilder |
geoWithin(DocumentAssignable geoJsonDoc)
Geospatial query for documents whose field intersects the specified
GeoJSON specified geometry. |
ConditionBuilder |
geoWithin(DocumentAssignable geoJsonDoc,
boolean unique)
Deprecated.
$uniqueDocs was removed in MongoDB 2.6. This method
will not be removed until two releases after the MongoDB 2.6
release (e.g. 2.10 if the releases are 2.8 and 2.10). |
String |
getFieldName()
Returns the fieldName value.
|
ConditionBuilder |
greaterThan(byte[] value)
Checks if the value is greater than the specified value.
|
ConditionBuilder |
greaterThan(byte subType,
byte[] value)
Checks if the value is greater than the specified value.
|
ConditionBuilder |
greaterThan(Date dateTime)
Checks if the value is greater than the specified dateTime.
|
ConditionBuilder |
greaterThan(double value)
Checks if the value is greater than the specified value.
|
ConditionBuilder |
greaterThan(int value)
Checks if the value is greater than the specified value.
|
ConditionBuilder |
greaterThan(long value)
Checks if the value is greater than the specified value.
|
ConditionBuilder |
greaterThan(ObjectId value)
Checks if the value is greater than the specified value.
|
ConditionBuilder |
greaterThan(String value)
Checks if the value is greater than the specified value.
|
ConditionBuilder |
greaterThanMongoTimestamp(long value)
Checks if the value is greater than the specified value.
|
ConditionBuilder |
greaterThanOrEqualTo(byte[] value)
Checks if the value is greater than or equals the specified
value.
|
ConditionBuilder |
greaterThanOrEqualTo(byte subType,
byte[] value)
Checks if the value is greater than or equals the specified
value.
|
ConditionBuilder |
greaterThanOrEqualTo(Date dateTime)
Checks if the value is greater than or equals the specified
dateTime.
|
ConditionBuilder |
greaterThanOrEqualTo(double value)
Checks if the value is greater than or equals the specified
value.
|
ConditionBuilder |
greaterThanOrEqualTo(int value)
Checks if the value is greater than or equals the specified
value.
|
ConditionBuilder |
greaterThanOrEqualTo(long value)
Checks if the value is greater than or equals the specified
value.
|
ConditionBuilder |
greaterThanOrEqualTo(ObjectId value)
Checks if the value is greater than or equals the specified
value.
|
ConditionBuilder |
greaterThanOrEqualTo(String value)
Checks if the value is greater than or equals the specified
value.
|
ConditionBuilder |
greaterThanOrEqualToMongoTimestamp(long value)
Checks if the value is greater than or equals the specified
value.
|
ConditionBuilder |
greaterThanOrEqualToSymbol(String value)
Checks if the value is greater than or equals the specified
value.
|
ConditionBuilder |
greaterThanOrEqualToTimestamp(long value)
Checks if the value is greater than or equals the specified
value.
|
ConditionBuilder |
greaterThanSymbol(String value)
Checks if the value is greater than the specified value.
|
ConditionBuilder |
greaterThanTimestamp(long value)
Checks if the value is greater than the specified value.
|
ConditionBuilder |
in(ArrayBuilder elements)
Specify the possible values to match against the field's value.
|
ConditionBuilder |
in(boolean... values)
Specify the possible values to match against the field's value.
|
ConditionBuilder |
in(byte[]... values)
Specify the possible values to match against the field's value.
|
ConditionBuilder |
in(Constant... values)
Specify the possible values to match against the field's value.
|
ConditionBuilder |
in(Date... values)
Specify the possible values to match against the field's value.
|
ConditionBuilder |
in(DocumentAssignable... values)
Specify the possible values to match against the field's value.
|
ConditionBuilder |
in(Double... values)
Specify the possible values to match against the field's value.
|
ConditionBuilder |
in(Element... elements)
Specify the possible values to match against the field's value.
|
ConditionBuilder |
in(Integer... values)
Specify the possible values to match against the field's value.
|
ConditionBuilder |
in(Long... values)
Specify the possible values to match against the field's value.
|
ConditionBuilder |
in(ObjectId... values)
Specify the possible values to match against the field's value.
|
ConditionBuilder |
in(Pattern... values)
Specify the possible values to match against the field's value.
|
ConditionBuilder |
in(String... values)
Specify the possible values to match against the field's value.
|
ConditionBuilder |
in(UUID... values)
Specify the possible values to match against the field's value.
|
ConditionBuilder |
instanceOf(ElementType type)
Checks if the value's type matches the specified type.
|
ConditionBuilder |
intersects(DocumentAssignable geoJsonDoc)
Geospatial query for documents whose field intersects the specified
GeoJSON specified geometry. |
ConditionBuilder |
lessThan(byte[] value)
Checks if the value is less than the specified value.
|
ConditionBuilder |
lessThan(byte subType,
byte[] value)
Checks if the value is less than the specified value.
|
ConditionBuilder |
lessThan(Date dateTime)
Checks if the value is less than the specified dateTime.
|
ConditionBuilder |
lessThan(double value)
Checks if the value is less than the specified value.
|
ConditionBuilder |
lessThan(int value)
Checks if the value is less than the specified value.
|
ConditionBuilder |
lessThan(long value)
Checks if the value is less than the specified value.
|
ConditionBuilder |
lessThan(ObjectId value)
Checks if the value is less than the specified value.
|
ConditionBuilder |
lessThan(String value)
Checks if the value is less than the specified value.
|
ConditionBuilder |
lessThanMongoTimestamp(long value)
Checks if the value is less than the specified value.
|
ConditionBuilder |
lessThanOrEqualTo(byte[] value)
Checks if the value is less than or equals the specified value.
|
ConditionBuilder |
lessThanOrEqualTo(byte subType,
byte[] value)
Checks if the value is less than or equals the specified value.
|
ConditionBuilder |
lessThanOrEqualTo(Date dateTime)
Checks if the value is less than or equals the specified
dateTime.
|
ConditionBuilder |
lessThanOrEqualTo(double value)
Checks if the value is less than or equals the specified value.
|
ConditionBuilder |
lessThanOrEqualTo(int value)
Checks if the value is less than or equals the specified value.
|
ConditionBuilder |
lessThanOrEqualTo(long value)
Checks if the value is less than or equals the specified value.
|
ConditionBuilder |
lessThanOrEqualTo(ObjectId value)
Checks if the value is less than or equals the specified value.
|
ConditionBuilder |
lessThanOrEqualTo(String value)
Checks if the value is less than or equals the specified value.
|
ConditionBuilder |
lessThanOrEqualToMongoTimestamp(long value)
Checks if the value is less than or equals the specified value.
|
ConditionBuilder |
lessThanOrEqualToSymbol(String value)
Checks if the value is less than or equals the specified value.
|
ConditionBuilder |
lessThanOrEqualToTimestamp(long value)
Checks if the value is less than or equals the specified value.
|
ConditionBuilder |
lessThanSymbol(String value)
Checks if the value is less than the specified value.
|
ConditionBuilder |
lessThanTimestamp(long value)
Checks if the value is less than the specified value.
|
ConditionBuilder |
matches(Pattern pattern)
Checks if the value matches the specified pattern.
|
ConditionBuilder |
mod(int divisor,
int remainder)
Checks if the modulo of the documents value and divisor equals
the remainder.
|
ConditionBuilder |
mod(long divisor,
long remainder)
Checks if the modulo of the documents value and divisor equals
the remainder.
|
ConditionBuilder |
near(DocumentAssignable geoJsonDoc)
Geospatial query for documents whose field is near the specified
GeoJSON specified geometry. |
ConditionBuilder |
near(DocumentAssignable geoJsonDoc,
double maxDistance)
Geospatial query for documents whose field is near the specified
GeoJSON specified geometry. |
ConditionBuilder |
near(double x,
double y)
Geospatial query for documents whose field is near the specified [
x, y] coordinates.
|
ConditionBuilder |
near(double x,
double y,
double maxDistance)
Geospatial query for documents whose field is near the specified [
x, y] coordinates.
|
ConditionBuilder |
near(int x,
int y)
Geospatial query for documents whose field is near the specified [
x, y] coordinates.
|
ConditionBuilder |
near(int x,
int y,
int maxDistance)
Geospatial query for documents whose field is near the specified [
x, y] coordinates.
|
ConditionBuilder |
near(long x,
long y)
Geospatial query for documents whose field is near the specified [
x, y] coordinates.
|
ConditionBuilder |
near(long x,
long y,
long maxDistance)
Geospatial query for documents whose field is near the specified [
x, y] coordinates.
|
ConditionBuilder |
nearSphere(DocumentAssignable geoJsonDoc)
Geospatial query for documents whose field is near the specified
GeoJSON specified geometry on a sphere. |
ConditionBuilder |
nearSphere(DocumentAssignable geoJsonDoc,
double maxDistance)
Geospatial query for documents whose field is near the specified
GeoJSON specified geometry on a sphere. |
ConditionBuilder |
nearSphere(double x,
double y)
Geospatial query for documents whose field is near the specified [
x, y] coordinates on a sphere.
|
ConditionBuilder |
nearSphere(double x,
double y,
double maxDistance)
Geospatial query for documents whose field is near the specified [
x, y] coordinates on a sphere.
|
ConditionBuilder |
nearSphere(int x,
int y)
Geospatial query for documents whose field is near the specified [
x, y] coordinates on a sphere.
|
ConditionBuilder |
nearSphere(int x,
int y,
int maxDistance)
Geospatial query for documents whose field is near the specified [
x, y] coordinates on a sphere.
|
ConditionBuilder |
nearSphere(long x,
long y)
Geospatial query for documents whose field is near the specified [
x, y] coordinates on a sphere.
|
ConditionBuilder |
nearSphere(long x,
long y,
long maxDistance)
Geospatial query for documents whose field is near the specified [
x, y] coordinates on a sphere.
|
ConditionBuilder |
notEqualTo(boolean value)
Checks if the value is not equal to the specified value.
|
ConditionBuilder |
notEqualTo(byte[] value)
Checks if the value is not equal to the specified value.
|
ConditionBuilder |
notEqualTo(byte subType,
byte[] value)
Checks if the value is not equal to the specified value.
|
ConditionBuilder |
notEqualTo(Date dateTime)
Checks if the value is not equal to the specified dateTime.
|
ConditionBuilder |
notEqualTo(DocumentAssignable value)
Checks if the value is not equal to the specified value.
|
ConditionBuilder |
notEqualTo(double value)
Checks if the value is not equal to the specified value.
|
ConditionBuilder |
notEqualTo(int value)
Checks if the value is not equal to the specified value.
|
ConditionBuilder |
notEqualTo(long value)
Checks if the value is not equal to the specified value.
|
ConditionBuilder |
notEqualTo(ObjectId value)
Checks if the value is not equal to the specified value.
|
ConditionBuilder |
notEqualTo(Pattern value)
Checks if the value is not equal to the specified value.
|
ConditionBuilder |
notEqualTo(String value)
Checks if the value is not equal to the specified value.
|
ConditionBuilder |
notEqualTo(UUID uuid)
Checks if the value is not equal to the specified uuid using the
standard UUID byte ordering.
|
ConditionBuilder |
notEqualToJavaScript(String value)
Checks if the value is not equal to the specified value.
|
ConditionBuilder |
notEqualToJavaScript(String value,
DocumentAssignable scope)
Checks if the value is not equal to the specified value.
|
ConditionBuilder |
notEqualToLegacy(UUID uuid)
Checks if the value is not equal to the specified uuid using the
legacy Java UUID byte ordering.
|
ConditionBuilder |
notEqualToMaxKey()
Checks if the value is not equal to the specified value.
|
ConditionBuilder |
notEqualToMinKey()
Checks if the value is not equal to the specified value.
|
ConditionBuilder |
notEqualToMongoTimestamp(long value)
Checks if the value is not equal to the specified value.
|
ConditionBuilder |
notEqualToNull()
Checks if the value is not equal to the specified value.
|
ConditionBuilder |
notEqualToSymbol(String value)
Checks if the value is not equal to the specified value.
|
ConditionBuilder |
notEqualToTimestamp(long value)
Checks if the value is not equal to the specified value.
|
ConditionBuilder |
notIn(ArrayBuilder elements)
Specify the values that must not match the field's value.
|
ConditionBuilder |
notIn(boolean... values)
Specify the values that must not match the field's value.
|
ConditionBuilder |
notIn(byte[]... values)
Specify the values that must not match the field's value.
|
ConditionBuilder |
notIn(Constant... values)
Specify the values that must not match the field's value.
|
ConditionBuilder |
notIn(Date... values)
Specify the values that must not match the field's value.
|
ConditionBuilder |
notIn(DocumentAssignable... values)
Specify the values that must not match the field's value.
|
ConditionBuilder |
notIn(Double... values)
Specify the values that must not match the field's value.
|
ConditionBuilder |
notIn(Element... elements)
Specify the values that must not match the field's value.
|
ConditionBuilder |
notIn(Integer... values)
Specify the values that must not match the field's value.
|
ConditionBuilder |
notIn(Long... values)
Specify the values that must not match the field's value.
|
ConditionBuilder |
notIn(ObjectId... values)
Specify the values that must not match the field's value.
|
ConditionBuilder |
notIn(Pattern... values)
Specify the values that must not match the field's value.
|
ConditionBuilder |
notIn(String... values)
Specify the values that must not match the field's value.
|
ConditionBuilder |
notIn(UUID... values)
Specify the values that must not match the field's value.
|
void |
reset()
Resets the builder back to an empty, no condition, state.
|
ConditionBuilder |
size(int length)
Checks if the value is an array of the specified length.
|
ConditionBuilder |
text(String textSearchExpression)
Adds a text query to the query.
|
ConditionBuilder |
text(String textSearchExpression,
String language)
Adds a text query to the query.
|
ConditionBuilder |
where(String javaScript)
Adds an ad-hoc JavaScript condition to the query.
|
ConditionBuilder |
within(boolean uniqueDocs,
Point2D p1,
Point2D p2,
Point2D p3,
Point2D... points)
Deprecated.
$uniqueDocs was removed in MongoDB 2.6. This method
will not be removed until two releases after the MongoDB 2.6
release (e.g. 2.10 if the releases are 2.8 and 2.10). |
ConditionBuilder |
within(DocumentAssignable geoJsonDoc)
Geospatial query for documents whose field is within the specified
GeoJSON specified geometry. |
ConditionBuilder |
within(DocumentAssignable geoJsonDoc,
boolean uniqueDocs)
Deprecated.
$uniqueDocs was removed in MongoDB 2.6. This method
will not be removed until two releases after the MongoDB 2.6
release (e.g. 2.10 if the releases are 2.8 and 2.10). |
ConditionBuilder |
within(double x,
double y,
double radius)
Geospatial query for documents whose field is within the specified
bounding circular region.
|
ConditionBuilder |
within(double x,
double y,
double radius,
boolean uniqueDocs)
Deprecated.
$uniqueDocs was removed in MongoDB 2.6. This method
will not be removed until two releases after the MongoDB 2.6
release (e.g. 2.10 if the releases are 2.8 and 2.10). |
ConditionBuilder |
within(double x1,
double y1,
double x2,
double y2)
Geospatial query for documents whose field is within the specified
bounding rectangular region.
|
ConditionBuilder |
within(double x1,
double y1,
double x2,
double y2,
boolean uniqueDocs)
Deprecated.
$uniqueDocs was removed in MongoDB 2.6. This method
will not be removed until two releases after the MongoDB 2.6
release (e.g. 2.10 if the releases are 2.8 and 2.10). |
ConditionBuilder |
within(int x,
int y,
int radius)
Geospatial query for documents whose field is within the specified
bounding circular region.
|
ConditionBuilder |
within(int x,
int y,
int radius,
boolean uniqueDocs)
Deprecated.
$uniqueDocs was removed in MongoDB 2.6. This method
will not be removed until two releases after the MongoDB 2.6
release (e.g. 2.10 if the releases are 2.8 and 2.10). |
ConditionBuilder |
within(int x1,
int y1,
int x2,
int y2)
Geospatial query for documents whose field is within the specified
bounding rectangular region.
|
ConditionBuilder |
within(int x1,
int y1,
int x2,
int y2,
boolean uniqueDocs)
Deprecated.
$uniqueDocs was removed in MongoDB 2.6. This method
will not be removed until two releases after the MongoDB 2.6
release (e.g. 2.10 if the releases are 2.8 and 2.10). |
ConditionBuilder |
within(long x,
long y,
long radius)
Geospatial query for documents whose field is within the specified
bounding circular region.
|
ConditionBuilder |
within(long x,
long y,
long radius,
boolean uniqueDocs)
Deprecated.
$uniqueDocs was removed in MongoDB 2.6. This method
will not be removed until two releases after the MongoDB 2.6
release (e.g. 2.10 if the releases are 2.8 and 2.10). |
ConditionBuilder |
within(long x1,
long y1,
long x2,
long y2)
Geospatial query for documents whose field is within the specified
bounding rectangular region.
|
ConditionBuilder |
within(long x1,
long y1,
long x2,
long y2,
boolean uniqueDocs)
Deprecated.
$uniqueDocs was removed in MongoDB 2.6. This method
will not be removed until two releases after the MongoDB 2.6
release (e.g. 2.10 if the releases are 2.8 and 2.10). |
ConditionBuilder |
within(Point2D p1,
Point2D p2,
Point2D p3,
Point2D... points)
Geospatial query for documents whose field is within the specified
bounding polygon.
|
ConditionBuilder |
withinOnSphere(double x,
double y,
double radius)
Geospatial query for documents whose field is within the specified
bounding circular region on a sphere.
|
ConditionBuilder |
withinOnSphere(double x,
double y,
double radius,
boolean uniqueDocs)
Deprecated.
$uniqueDocs was removed in MongoDB 2.6. This method
will not be removed until two releases after the MongoDB 2.6
release (e.g. 2.10 if the releases are 2.8 and 2.10). |
ConditionBuilder |
withinOnSphere(int x,
int y,
int radius)
Geospatial query for documents whose field is within the specified
bounding circular region on a sphere.
|
ConditionBuilder |
withinOnSphere(int x,
int y,
int radius,
boolean uniqueDocs)
Deprecated.
$uniqueDocs was removed in MongoDB 2.6. This method
will not be removed until two releases after the MongoDB 2.6
release (e.g. 2.10 if the releases are 2.8 and 2.10). |
ConditionBuilder |
withinOnSphere(long x,
long y,
long radius)
Geospatial query for documents whose field is within the specified
bounding circular region on a sphere.
|
ConditionBuilder |
withinOnSphere(long x,
long y,
long radius,
boolean uniqueDocs)
Deprecated.
$uniqueDocs was removed in MongoDB 2.6. This method
will not be removed until two releases after the MongoDB 2.6
release (e.g. 2.10 if the releases are 2.8 and 2.10). |
protected ConditionBuilder(String fieldName, QueryBuilder parent)
This constructor is protected since generally users will use the
QueryBuilder
class to create a condition builder.
fieldName
- The name for the field to compare.parent
- The parent builder for this condition.public ConditionBuilder after(Date dateTime)
This is equivalent to greaterThanTimestamp(dateTime.getTime())
.
Only a single greaterThan(...)
comparison can
be used. Calling multiple greaterThan(...)
methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
dateTime
- The value to compare the field against.greaterThanTimestamp(long)
public ConditionBuilder all(ArrayBuilder elements)
Only a single all(ArrayBuilder)
comparison can be used. Calling
multiple all(...) methods overwrites previous values. In
addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
elements
- A builder for the values for the comparison. Any changes to
the ArrayBuilder
after this method is called are not
reflected in the comparison.public ConditionBuilder all(boolean... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the all(Constant...)
method.ArrayBuilder
with the all(ArrayBuilder)
method.elements
and use the
all(Element...)
method.
Only a single all(ArrayBuilder)
comparison can be used. Calling
multiple all(...) methods overwrites previous values. In
addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder all(byte[]... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the all(Constant...)
method.ArrayBuilder
with the all(ArrayBuilder)
method.elements
and use the
all(Element...)
method.
Only a single all(ArrayBuilder)
comparison can be used. Calling
multiple all(...) methods overwrites previous values. In
addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder all(Constant... values)
This method is designed to be used with the Expressions.constant(...)
helper methods.
import static
com.allanbank.mongodb.builder.expression.Expressions.constant
; DocumentAssignable query = QueryBuilder.where("f").all(constant(1), constant(2), constant(3));
Only a single all(Element[])
comparison can be used. Calling
multiple all(...) methods overwrites previous values. In
addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder all(Date... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the all(Constant...)
method.ArrayBuilder
with the all(ArrayBuilder)
method.elements
and use the
all(Element...)
method.
Only a single all(ArrayBuilder)
comparison can be used. Calling
multiple all(...) methods overwrites previous values. In
addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder all(DocumentAssignable... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the all(Constant...)
method.ArrayBuilder
with the all(ArrayBuilder)
method.elements
and use the
all(Element...)
method.
Only a single all(ArrayBuilder)
comparison can be used. Calling
multiple all(...) methods overwrites previous values. In
addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder all(Double... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the all(Constant...)
method.ArrayBuilder
with the all(ArrayBuilder)
method.elements
and use the
all(Element...)
method.
Only a single all(ArrayBuilder)
comparison can be used. Calling
multiple all(...) methods overwrites previous values. In
addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder all(Element... elements)
Only a single all(Element[])
comparison can be used. Calling
multiple all(...) methods overwrites previous values. In
addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
elements
- The element values for the comparison.public ConditionBuilder all(Integer... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the all(Constant...)
method.ArrayBuilder
with the all(ArrayBuilder)
method.elements
and use the
all(Element...)
method.
Only a single all(ArrayBuilder)
comparison can be used. Calling
multiple all(...) methods overwrites previous values. In
addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder all(Long... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the all(Constant...)
method.ArrayBuilder
with the all(ArrayBuilder)
method.elements
and use the
all(Element...)
method.
Only a single all(ArrayBuilder)
comparison can be used. Calling
multiple all(...) methods overwrites previous values. In
addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder all(ObjectId... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the all(Constant...)
method.ArrayBuilder
with the all(ArrayBuilder)
method.elements
and use the
all(Element...)
method.
Only a single all(ArrayBuilder)
comparison can be used. Calling
multiple all(...) methods overwrites previous values. In
addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder all(Pattern... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the all(Constant...)
method.ArrayBuilder
with the all(ArrayBuilder)
method.elements
and use the
all(Element...)
method.
Only a single all(ArrayBuilder)
comparison can be used. Calling
multiple all(...) methods overwrites previous values. In
addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder all(String... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the all(Constant...)
method.ArrayBuilder
with the all(ArrayBuilder)
method.elements
and use the
all(Element...)
method.
Only a single all(ArrayBuilder)
comparison can be used. Calling
multiple all(...) methods overwrites previous values. In
addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder all(UUID... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the all(Constant...)
method.ArrayBuilder
with the all(ArrayBuilder)
method.elements
and use the
all(Element...)
method.
Only a single all(ArrayBuilder)
comparison can be used. Calling
multiple all(...) methods overwrites previous values. In
addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder and(String fieldName)
field name
then this builder will be returned. Otherwise a different
builder will be returned sharing the same parent QueryBuilder
.fieldName
- The name of the field to create a conjunction with.ConditionBuilder
to use to construct the conjunction.public Document asDocument()
Returns the result of build()
.
asDocument
in interface DocumentAssignable
build()
public ConditionBuilder before(Date dateTime)
This is equivalent to lessThanTimestamp(dateTime.getTime())
.
Only a single lessThan(...)
comparison can be
used. Calling multiple lessThan(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
dateTime
- The value to compare the field against.lessThanTimestamp(long)
public Document build()
QueryBuilder
.QueryBuilder
.QueryBuilder.build()
public ConditionBuilder comment(String comment)
$comment
to the query.
Comments are useful for locating queries in the profiler log within
MongoDB.
Note that the $comment
operator
does not apply to a specific field but applies to the document as a
whole. For this reason only a single comment(java.lang.String)
condition can be
used. Calling multiple comment(...) methods overwrites previous
values.
comment
- The comment to add to the query.public ConditionBuilder elementMatches(DocumentAssignable arrayElementQuery)
Only a single elementMatches(DocumentAssignable)
comparison can
be used. Calling multiple elementMatches(...) methods overwrites
previous values. In addition any equals(...)
condition is removed since no equality operator is supported by MongoDB.
arrayElementQuery
- A builder for the query to match a sub element. Any changes to
the QueryBuilder
after this method is called are not
reflected in the comparison.public ConditionBuilder equals(boolean value)
Only a single equals(...)
comparison can be
used. Calling multiple equals(...)
methods
overwrites previous values. In addition equals(...) removes all
other conditions from the builder since there is no equal operator
supported by MongoDB.
value
- The value to compare the field against.public ConditionBuilder equals(byte subType, byte[] value)
Only a single equals(...)
comparison can be
used. Calling multiple equals(...)
methods
overwrites previous values. In addition equals(...) removes all
other conditions from the builder since there is no equal operator
supported by MongoDB.
subType
- The binary values subtype.value
- The value to compare the field against.public ConditionBuilder equals(byte[] value)
Only a single equals(...)
comparison can be
used. Calling multiple equals(...)
methods
overwrites previous values. In addition equals(...) removes all
other conditions from the builder since there is no equal operator
supported by MongoDB.
value
- The value to compare the field against.public ConditionBuilder equals(Date dateTime)
This is equivalent to equalsTimestamp(dateTime.getTime())
.
Only a single equals(...)
comparison can be
used. Calling multiple equals(...)
methods
overwrites previous values. In addition equals(...) removes all
other conditions from the builder since there is no equal operator
supported by MongoDB.
dateTime
- The value to compare the field against.equalsTimestamp(long)
public ConditionBuilder equals(DocumentAssignable value)
Only a single equals(...)
comparison can be
used. Calling multiple equals(...)
methods
overwrites previous values. In addition equals(...) removes all
other conditions from the builder since there is no equal operator
supported by MongoDB.
value
- The value to compare the field against.public ConditionBuilder equals(double value)
NOTE: Queries for matching a double value that closely approximates an integer value (e.g., 1.00) will compare equal to a stored integer or long value.
Only a single equals(...)
comparison can be
used. Calling multiple equals(...)
methods
overwrites previous values. In addition equals(...) removes all
other conditions from the builder since there is no equal operator
supported by MongoDB.
value
- The value to compare the field against.public ConditionBuilder equals(int value)
NOTE: Queries for matching a integer value will compare equals to an equivalent stored long or closely matching double value.
Only a single equals(...)
comparison can be
used. Calling multiple equals(...)
methods
overwrites previous values. In addition equals(...) removes all
other conditions from the builder since there is no equal operator
supported by MongoDB.
value
- The value to compare the field against.public ConditionBuilder equals(long value)
NOTE: Queries for matching a long value will compare equals to an equivalent stored integer or closely matching double value.
Only a single equals(...)
comparison can be
used. Calling multiple equals(...)
methods
overwrites previous values. In addition equals(...) removes all
other conditions from the builder since there is no equal operator
supported by MongoDB.
value
- The value to compare the field against.public ConditionBuilder equals(ObjectId value)
Only a single equals(...)
comparison can be
used. Calling multiple equals(...)
methods
overwrites previous values. In addition equals(...) removes all
other conditions from the builder since there is no equal operator
supported by MongoDB.
value
- The value to compare the field against.public ConditionBuilder equals(Pattern value)
NOTE: This checks if the value is a regular expression
or if it is a string or symbol that matches the regular
expression. It is functionally equivalent to matches(Pattern)
.
Only a single equals(...)
comparison can be
used. Calling multiple equals(...)
methods
overwrites previous values. In addition equals(...) removes all
other conditions from the builder since there is no equal operator
supported by MongoDB.
value
- The value to compare the field against.matches(Pattern)
public ConditionBuilder equals(String value)
NOTE: This method will match against a string or a symbol type element.
Only a single equals(...)
comparison can be
used. Calling multiple equals(...)
methods
overwrites previous values. In addition equals(...) removes all
other conditions from the builder since there is no equal operator
supported by MongoDB.
value
- The value to compare the field against.public ConditionBuilder equals(UUID uuid)
Only a single equals(...)
comparison can be
used. Calling multiple equals(...)
methods
overwrites previous values. In addition equals(...) removes all
other conditions from the builder since there is no equal operator
supported by MongoDB.
uuid
- The value to compare the field against.public ConditionBuilder equalsJavaScript(String value)
Only a single equals(...)
comparison can be
used. Calling multiple equals(...)
methods
overwrites previous values. In addition equals(...) removes all
other conditions from the builder since there is no equal operator
supported by MongoDB.
value
- The value to compare the field against.public ConditionBuilder equalsJavaScript(String value, DocumentAssignable scope)
NOTE: Testing has shown that the scope is ignored when performing the comparison.
Only a single equals(...)
comparison can be
used. Calling multiple equals(...)
methods
overwrites previous values. In addition equals(...) removes all
other conditions from the builder since there is no equal operator
supported by MongoDB.
value
- The value to compare the field against.scope
- The stored scope value.public ConditionBuilder equalsLegacy(UUID uuid)
Only a single equals(...)
comparison can be
used. Calling multiple equals(...)
methods
overwrites previous values. In addition equals(...) removes all
other conditions from the builder since there is no equal operator
supported by MongoDB.
uuid
- The value to compare the field against.public ConditionBuilder equalsMaxKey()
WARNING: Testing has shown that this query matches all documents even if they do not contain any value for the field.
Only a single equals(...)
comparison can be
used. Calling multiple equals(...)
methods
overwrites previous values. In addition equals(...) removes all
other conditions from the builder since there is no equal operator
supported by MongoDB.
public ConditionBuilder equalsMinKey()
WARNING: Testing has shown that this query matches all documents even if they do not contain any value for the field.
Only a single equals(...)
comparison can be
used. Calling multiple equals(...)
methods
overwrites previous values. In addition equals(...) removes all
other conditions from the builder since there is no equal operator
supported by MongoDB.
public ConditionBuilder equalsMongoTimestamp(long value)
WARNING: Testing has shown that this query will throw a
QueryFailedException
if a document contains a field with the same
name but of type ElementType.UTC_TIMESTAMP
.
Only a single equals(...)
comparison can be
used. Calling multiple equals(...)
methods
overwrites previous values. In addition equals(...) removes all
other conditions from the builder since there is no equal operator
supported by MongoDB.
value
- The value to compare the field against.public ConditionBuilder equalsNull()
Note: A field is considered to be null
if it is a
literal null
value in the document OR it does not
contain the field.
Only a single equals(...)
comparison can be
used. Calling multiple equals(...)
methods
overwrites previous values. In addition equals(...) removes all
other conditions from the builder since there is no equal operator
supported by MongoDB.
public ConditionBuilder equalsSymbol(String value)
Only a single equals(...)
comparison can be
used. Calling multiple equals(...)
methods
overwrites previous values. In addition equals(...) removes all
other conditions from the builder since there is no equal operator
supported by MongoDB.
value
- The value to compare the field against.public ConditionBuilder equalsTimestamp(long value)
NOTE: Queries for matching a timestamp value will compare equals to an equivalent stored MongoTimestamp value.
Only a single equals(...)
comparison can be
used. Calling multiple equals(...)
methods
overwrites previous values. In addition equals(...) removes all
other conditions from the builder since there is no equal operator
supported by MongoDB.
value
- The value to compare the field against.public ConditionBuilder exists()
Only a single exists(...)
comparison can be
used. Calling multiple exists(...)
methods overwrites
previous values. In addition any equals(...)
condition is removed since no equality operator is supported by MongoDB.
This method is equivalent to calling exists(true)
.
public ConditionBuilder exists(boolean value)
Only a single exists(...)
comparison can be
used. Calling multiple exists(...)
methods overwrites
previous values. In addition any equals(...)
condition is removed since no equality operator is supported by MongoDB.
value
- If true the field must exist. If false the field must not
exist.public ConditionBuilder geoWithin(DocumentAssignable geoJsonDoc)
GeoJSON
specified geometry.
This method is designed to be use with a GeoJSON document constructed
with the GeoJson
class
where
("geo").intersects(GeoJson.lineString
(GeoJson.p
(1,2),GeoJson.p
(10,11) ) );
NOTE: The $geoIntersects
operator requires a
2dsphere
index.
Only a single geoWithin(com.allanbank.mongodb.bson.DocumentAssignable)
comparison can be used. Calling multiple
geoWithin(...) methods overwrites previous values. In addition
any equals(...)
condition is removed since no
equality operator is supported by MongoDB.
geoJsonDoc
- The GeoJSON document describing the geometry.@Deprecated public ConditionBuilder geoWithin(DocumentAssignable geoJsonDoc, boolean unique)
$uniqueDocs
was removed in MongoDB 2.6. This method
will not be removed until two releases after the MongoDB 2.6
release (e.g. 2.10 if the releases are 2.8 and 2.10).GeoJSON
specified geometry.
This method is designed to be use with a GeoJSON document constructed
with the GeoJson
class
where
("geo").intersects(GeoJson.lineString
(GeoJson.p
(1,2),GeoJson.p
(10,11) ) );
NOTE: The $geoIntersects
operator requires a
2dsphere
index.
Only a single geoWithin(com.allanbank.mongodb.bson.DocumentAssignable)
comparison can be used. Calling multiple
geoWithin(...) methods overwrites previous values. In addition
any equals(...)
condition is removed since no
equality operator is supported by MongoDB.
geoJsonDoc
- The GeoJSON document describing the geometry.unique
- If false then the query will return a document with multiple
matching shaped or points multiple times.public String getFieldName()
public ConditionBuilder greaterThan(byte subType, byte[] value)
Only a single greaterThan(...)
comparison can
be used. Calling multiple greaterThan(...)
methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
subType
- The binary values subtype.value
- The value to compare the field against.public ConditionBuilder greaterThan(byte[] value)
Only a single greaterThan(...)
comparison can
be used. Calling multiple greaterThan(...)
methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
value
- The value to compare the field against.public ConditionBuilder greaterThan(Date dateTime)
This is equivalent to greaterThanTimestamp(dateTime.getTime())
.
Only a single greaterThan(...)
comparison can
be used. Calling multiple greaterThan(...)
methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
dateTime
- The value to compare the field against.greaterThanTimestamp(long)
public ConditionBuilder greaterThan(double value)
Only a single greaterThan(...)
comparison can
be used. Calling multiple greaterThan(...)
methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
value
- The value to compare the field against.public ConditionBuilder greaterThan(int value)
Only a single greaterThan(...)
comparison can
be used. Calling multiple greaterThan(...)
methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
value
- The value to compare the field against.public ConditionBuilder greaterThan(long value)
Only a single greaterThan(...)
comparison can
be used. Calling multiple greaterThan(...)
methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
value
- The value to compare the field against.public ConditionBuilder greaterThan(ObjectId value)
Only a single greaterThan(...)
comparison can
be used. Calling multiple greaterThan(...)
methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
value
- The value to compare the field against.public ConditionBuilder greaterThan(String value)
Only a single greaterThan(...)
comparison can
be used. Calling multiple greaterThan(...)
methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
value
- The value to compare the field against.public ConditionBuilder greaterThanMongoTimestamp(long value)
Only a single greaterThan(...)
comparison can
be used. Calling multiple greaterThan(...)
methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
value
- The value to compare the field against.public ConditionBuilder greaterThanOrEqualTo(byte subType, byte[] value)
Only a single greaterThanOrEqualTo(...)
comparison can be used. Calling multiple
greaterThanOrEqualTo(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
subType
- The binary values subtype.value
- The value to compare the field against.public ConditionBuilder greaterThanOrEqualTo(byte[] value)
Only a single greaterThanOrEqualTo(...)
comparison can be used. Calling multiple
greaterThanOrEqualTo(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder greaterThanOrEqualTo(Date dateTime)
This is equivalent to greaterThanOrEqualToTimestamp(dateTime.getTime())
.
Only a single greaterThanOrEqualTo(...)
comparison can be used. Calling multiple
greaterThanOrEqualTo(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
dateTime
- The value to compare the field against.greaterThanOrEqualToTimestamp(long)
public ConditionBuilder greaterThanOrEqualTo(double value)
Only a single greaterThanOrEqualTo(...)
comparison can be used. Calling multiple
greaterThanOrEqualTo(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder greaterThanOrEqualTo(int value)
Only a single greaterThanOrEqualTo(...)
comparison can be used. Calling multiple
greaterThanOrEqualTo(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder greaterThanOrEqualTo(long value)
Only a single greaterThanOrEqualTo(...)
comparison can be used. Calling multiple
greaterThanOrEqualTo(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder greaterThanOrEqualTo(ObjectId value)
Only a single greaterThanOrEqualTo(...)
comparison can be used. Calling multiple
greaterThanOrEqualTo(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder greaterThanOrEqualTo(String value)
Only a single greaterThanOrEqualTo(...)
comparison can be used. Calling multiple
greaterThanOrEqualTo(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder greaterThanOrEqualToMongoTimestamp(long value)
Only a single greaterThanOrEqualTo(...)
comparison can be used. Calling multiple
greaterThanOrEqualTo(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder greaterThanOrEqualToSymbol(String value)
Only a single greaterThanOrEqualTo(...)
comparison can be used. Calling multiple
greaterThanOrEqualTo(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder greaterThanOrEqualToTimestamp(long value)
Only a single greaterThanOrEqualTo(...)
comparison can be used. Calling multiple
greaterThanOrEqualTo(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder greaterThanSymbol(String value)
Only a single greaterThan(...)
comparison can
be used. Calling multiple greaterThan(...)
methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
value
- The value to compare the field against.public ConditionBuilder greaterThanTimestamp(long value)
Only a single greaterThan(...)
comparison can
be used. Calling multiple greaterThan(...)
methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
value
- The value to compare the field against.public ConditionBuilder in(ArrayBuilder elements)
Only a single in(ArrayBuilder)
comparison can be used. Calling
multiple in(...) methods overwrites previous values. In addition
any equals(...)
condition is removed since no
equality operator is supported by MongoDB.
elements
- A builder for the values for the comparison. Any changes to
the ArrayBuilder
after this method is called are not
reflected in the comparison.public ConditionBuilder in(boolean... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the in(Constant...)
method.ArrayBuilder
with the in(ArrayBuilder)
method.elements
and use the
in(Element...)
method.
Only a single in(Element[])
comparison can be used. Calling
multiple in(...) methods overwrites previous values. In addition
any equals(...)
condition is removed since no
equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder in(byte[]... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the in(Constant...)
method.ArrayBuilder
with the in(ArrayBuilder)
method.elements
and use the
in(Element...)
method.
Only a single in(Element[])
comparison can be used. Calling
multiple in(...) methods overwrites previous values. In addition
any equals(...)
condition is removed since no
equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder in(Constant... values)
This method is designed to be used with the Expressions.constant(...)
helper methods.
import static
com.allanbank.mongodb.builder.expression.Expressions.constant
; DocumentAssignable query = QueryBuilder.where("f").in(constant(1), constant(2), constant(3));
Only a single in(Element[])
comparison can be used. Calling
multiple in(...) methods overwrites previous values. In addition
any equals(...)
condition is removed since no
equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder in(Date... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the in(Constant...)
method.ArrayBuilder
with the in(ArrayBuilder)
method.elements
and use the
in(Element...)
method.
Only a single in(Element[])
comparison can be used. Calling
multiple in(...) methods overwrites previous values. In addition
any equals(...)
condition is removed since no
equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder in(DocumentAssignable... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the in(Constant...)
method.ArrayBuilder
with the in(ArrayBuilder)
method.elements
and use the
in(Element...)
method.
Only a single in(Element[])
comparison can be used. Calling
multiple in(...) methods overwrites previous values. In addition
any equals(...)
condition is removed since no
equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder in(Double... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the in(Constant...)
method.ArrayBuilder
with the in(ArrayBuilder)
method.elements
and use the
in(Element...)
method.
Only a single in(Element[])
comparison can be used. Calling
multiple in(...) methods overwrites previous values. In addition
any equals(...)
condition is removed since no
equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder in(Element... elements)
Only a single in(Element[])
comparison can be used. Calling
multiple in(...) methods overwrites previous values. In addition
any equals(...)
condition is removed since no
equality operator is supported by MongoDB.
elements
- The element values for the comparison.public ConditionBuilder in(Integer... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the in(Constant...)
method.ArrayBuilder
with the in(ArrayBuilder)
method.elements
and use the
in(Element...)
method.
Only a single in(Element[])
comparison can be used. Calling
multiple in(...) methods overwrites previous values. In addition
any equals(...)
condition is removed since no
equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder in(Long... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the in(Constant...)
method.ArrayBuilder
with the in(ArrayBuilder)
method.elements
and use the
in(Element...)
method.
Only a single in(Element[])
comparison can be used. Calling
multiple in(...) methods overwrites previous values. In addition
any equals(...)
condition is removed since no
equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder in(ObjectId... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the in(Constant...)
method.ArrayBuilder
with the in(ArrayBuilder)
method.elements
and use the
in(Element...)
method.
Only a single in(Element[])
comparison can be used. Calling
multiple in(...) methods overwrites previous values. In addition
any equals(...)
condition is removed since no
equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder in(Pattern... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the in(Constant...)
method.ArrayBuilder
with the in(ArrayBuilder)
method.elements
and use the
in(Element...)
method.
Only a single in(Element[])
comparison can be used. Calling
multiple in(...) methods overwrites previous values. In addition
any equals(...)
condition is removed since no
equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder in(String... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the in(Constant...)
method.ArrayBuilder
with the in(ArrayBuilder)
method.elements
and use the
in(Element...)
method.
Only a single in(Element[])
comparison can be used. Calling
multiple in(...) methods overwrites previous values. In addition
any equals(...)
condition is removed since no
equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder in(UUID... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the in(Constant...)
method.ArrayBuilder
with the in(ArrayBuilder)
method.elements
and use the
in(Element...)
method.
Only a single in(Element[])
comparison can be used. Calling
multiple in(...) methods overwrites previous values. In addition
any equals(...)
condition is removed since no
equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder instanceOf(ElementType type)
Only a single instanceOf(ElementType)
comparison can be used.
Calling multiple instanceOf(ElementType)
methods overwrites
previous values. In addition any equals(...)
condition is removed since no equality operator is supported by MongoDB.
type
- The expected type for the value.public ConditionBuilder intersects(DocumentAssignable geoJsonDoc)
GeoJSON
specified geometry.
This method is designed to be use with a GeoJSON document constructed
with the GeoJson
class
where
("geo").intersects(GeoJson.lineString
(GeoJson.p
(1,2),GeoJson.p
(10,11) ) );
NOTE: The $geoIntersects
operator requires a
2dsphere
index.
Only a single intersects(com.allanbank.mongodb.bson.DocumentAssignable)
comparison can be used. Calling
multiple intersects(...) methods overwrites previous values. In
addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
geoJsonDoc
- The GeoJSON document describing the geometry.public ConditionBuilder lessThan(byte subType, byte[] value)
Only a single lessThan(...)
comparison can be
used. Calling multiple lessThan(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
subType
- The binary values subtype.value
- The value to compare the field against.public ConditionBuilder lessThan(byte[] value)
Only a single lessThan(...)
comparison can be
used. Calling multiple lessThan(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder lessThan(Date dateTime)
This is equivalent to lessThanTimestamp(dateTime.getTime())
.
Only a single lessThan(...)
comparison can be
used. Calling multiple lessThan(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
dateTime
- The value to compare the field against.lessThanTimestamp(long)
public ConditionBuilder lessThan(double value)
Only a single lessThan(...)
comparison can be
used. Calling multiple lessThan(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder lessThan(int value)
Only a single lessThan(...)
comparison can be
used. Calling multiple lessThan(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder lessThan(long value)
Only a single lessThan(...)
comparison can be
used. Calling multiple lessThan(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder lessThan(ObjectId value)
Only a single lessThan(...)
comparison can be
used. Calling multiple lessThan(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder lessThan(String value)
Only a single lessThan(...)
comparison can be
used. Calling multiple lessThan(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder lessThanMongoTimestamp(long value)
Only a single lessThan(...)
comparison can be
used. Calling multiple lessThan(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder lessThanOrEqualTo(byte subType, byte[] value)
Only a single lessThanOrEqualTo(...)
comparison can be used. Calling multiple
lessThanOrEqualTo(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
subType
- The binary values subtype.value
- The value to compare the field against.public ConditionBuilder lessThanOrEqualTo(byte[] value)
Only a single lessThanOrEqualTo(...)
comparison can be used. Calling multiple
lessThanOrEqualTo(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder lessThanOrEqualTo(Date dateTime)
This is equivalent to lessThanOrEqualToTimestamp(dateTime.getTime())
.
Only a single lessThanOrEqualTo(...)
comparison can be used. Calling multiple
lessThanOrEqualTo(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
dateTime
- The value to compare the field against.lessThanOrEqualToTimestamp(long)
public ConditionBuilder lessThanOrEqualTo(double value)
Only a single lessThanOrEqualTo(...)
comparison can be used. Calling multiple
lessThanOrEqualTo(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder lessThanOrEqualTo(int value)
Only a single lessThanOrEqualTo(...)
comparison can be used. Calling multiple
lessThanOrEqualTo(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder lessThanOrEqualTo(long value)
Only a single lessThanOrEqualTo(...)
comparison can be used. Calling multiple
lessThanOrEqualTo(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder lessThanOrEqualTo(ObjectId value)
Only a single lessThanOrEqualTo(...)
comparison can be used. Calling multiple
lessThanOrEqualTo(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder lessThanOrEqualTo(String value)
Only a single lessThanOrEqualTo(...)
comparison can be used. Calling multiple
lessThanOrEqualTo(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder lessThanOrEqualToMongoTimestamp(long value)
Only a single lessThanOrEqualTo(...)
comparison can be used. Calling multiple
lessThanOrEqualTo(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder lessThanOrEqualToSymbol(String value)
Only a single lessThanOrEqualTo(...)
comparison can be used. Calling multiple
lessThanOrEqualTo(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder lessThanOrEqualToTimestamp(long value)
Only a single lessThanOrEqualTo(...)
comparison can be used. Calling multiple
lessThanOrEqualTo(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder lessThanSymbol(String value)
Only a single lessThan(...)
comparison can be
used. Calling multiple lessThan(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder lessThanTimestamp(long value)
Only a single lessThan(...)
comparison can be
used. Calling multiple lessThan(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder matches(Pattern pattern)
NOTE: This checks if the value is a regular expression or
if it is a string or symbol that matches the regular expression. It is
functionally equivalent to equals(Pattern)
.
Only a single matches(Pattern)
comparison can be used. Calling
multiple matches(Pattern)
methods overwrites previous values. In
addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
This method is equivalent to calling exists(true)
.
pattern
- The pattern to match the value against.public ConditionBuilder mod(int divisor, int remainder)
Only a single mod(int,int)
comparison can be used. Calling
multiple mod(long,long)
methods overwrites previous values. In
addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
divisor
- The divisor for the modulo operation.remainder
- The desired remainder from the modulo operation.public ConditionBuilder mod(long divisor, long remainder)
Only a single mod(int,int)
comparison can be used. Calling
multiple mod(long,long)
methods overwrites previous values. In
addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
divisor
- The divisor for the modulo operation.remainder
- The desired remainder from the modulo operation.public ConditionBuilder near(DocumentAssignable geoJsonDoc)
GeoJSON
specified geometry.
This method is designed to be use with a GeoJSON document constructed
with the GeoJson
class
where
("geo").near(GeoJson.lineString
(GeoJson.p
(1,2),GeoJson.p
(10,11) ) );
NOTE: The $near
operator is not supported with sharded
clusters.
NOTE: The $near
operator with a GeoJSON document requires
a 2dsphere
index.
Only a single near(com.allanbank.mongodb.bson.DocumentAssignable)
comparison can be used. Calling multiple
near(...) methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
geoJsonDoc
- The GeoJSON document describing the geometry.public ConditionBuilder near(DocumentAssignable geoJsonDoc, double maxDistance)
GeoJSON
specified geometry.
This method is designed to be use with a GeoJSON document constructed
with the GeoJson
class
where
("geo").near(GeoJson.lineString
(GeoJson.p
(1,2),GeoJson.p
(10,11) ), 42 );
NOTE: The $near
operator is not supported with sharded
clusters.
NOTE: The $near
operator with a GeoJSON document requires
a 2dsphere
index.
Only a single near(com.allanbank.mongodb.bson.DocumentAssignable)
comparison can be used. Calling multiple
near(...) methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
geoJsonDoc
- The GeoJSON document describing the geometry.maxDistance
- Limits to documents returned to those within the specified
maximum distance.public ConditionBuilder near(double x, double y)
NOTE: The x and y values must be in the range
[-180, 180) or the query will throw a QueryFailedException
.
NOTE: The $near
operator is not supported with sharded
clusters.
Only a single near(com.allanbank.mongodb.bson.DocumentAssignable)
comparison can be used. Calling multiple
near(...) methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
x
- The X coordinate to find documents near.y
- The Y coordinate to find documents near.public ConditionBuilder near(double x, double y, double maxDistance)
NOTE: The x and y values must be in the range
[-180, 180) or the query will throw a QueryFailedException
.
NOTE: The $near
operator is not supported with sharded
clusters.
Only a single near(com.allanbank.mongodb.bson.DocumentAssignable)
comparison can be used. Calling multiple
near(...) methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
x
- The X coordinate to find documents near.y
- The Y coordinate to find documents near.maxDistance
- Limits to documents returned to those within the specified
maximum distance.public ConditionBuilder near(int x, int y)
NOTE: The x and y values must be in the range
[-180, 180) or the query will throw a QueryFailedException
.
NOTE: The $near
operator is not supported with sharded
clusters.
Only a single near(com.allanbank.mongodb.bson.DocumentAssignable)
comparison can be used. Calling multiple
near(...) methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
x
- The X coordinate to find documents near.y
- The Y coordinate to find documents near.public ConditionBuilder near(int x, int y, int maxDistance)
NOTE: The x and y values must be in the range
[-180, 180) or the query will throw a QueryFailedException
.
NOTE: The $near
operator is not supported with sharded
clusters.
Only a single near(com.allanbank.mongodb.bson.DocumentAssignable)
comparison can be used. Calling multiple
near(...) methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
x
- The X coordinate to find documents near.y
- The Y coordinate to find documents near.maxDistance
- Limits to documents returned to those within the specified
maximum distance.public ConditionBuilder near(long x, long y)
NOTE: The x and y values must be in the range
[-180, 180) or the query will throw a QueryFailedException
.
NOTE: The $near
operator is not supported with sharded
clusters.
Only a single near(com.allanbank.mongodb.bson.DocumentAssignable)
comparison can be used. Calling multiple
near(...) methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
x
- The X coordinate to find documents near.y
- The Y coordinate to find documents near.public ConditionBuilder near(long x, long y, long maxDistance)
NOTE: The x and y values must be in the range
[-180, 180) or the query will throw a QueryFailedException
.
NOTE: The $near
operator is not supported with sharded
clusters.
Only a single near(com.allanbank.mongodb.bson.DocumentAssignable)
comparison can be used. Calling multiple
near(...) methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
x
- The X coordinate to find documents near.y
- The Y coordinate to find documents near.maxDistance
- Limits to documents returned to those within the specified
maximum distance.public ConditionBuilder nearSphere(DocumentAssignable geoJsonDoc)
GeoJSON
specified geometry on a sphere.
This method is designed to be use with a GeoJSON document constructed
with the GeoJson
class
where
("geo").nearSphere(GeoJson.lineString
(GeoJson.p
(1,2),GeoJson.p
(10,11) ) );
NOTE: The $nearSphere
operator is not supported with
sharded clusters.
NOTE: The $nearSphere
operator with a GeoJSON document
requires a 2dsphere
index.
Only a single nearSphere(com.allanbank.mongodb.bson.DocumentAssignable)
comparison can be used. Calling
multiple near(...) methods overwrites previous values. In
addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
geoJsonDoc
- The GeoJSON document describing the geometry.public ConditionBuilder nearSphere(DocumentAssignable geoJsonDoc, double maxDistance)
GeoJSON
specified geometry on a sphere.
This method is designed to be use with a GeoJSON document constructed
with the GeoJson
class
where
("geo").nearSphere(GeoJson.lineString
(GeoJson.p
(1,2),GeoJson.p
(10,11) ), 42 );
NOTE: The $nearSphere
operator is not supported with
sharded clusters.
NOTE: The $nearSphere
operator with a GeoJSON document
requires a 2dsphere
index.
Only a single nearSphere(com.allanbank.mongodb.bson.DocumentAssignable)
comparison can be used. Calling
multiple near(...) methods overwrites previous values. In
addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
geoJsonDoc
- The GeoJSON document describing the geometry.maxDistance
- Limits to documents returned to those within the specified
maximum distance.public ConditionBuilder nearSphere(double x, double y)
NOTE: The x must be within the range [-180, 180) and the
y values must be in the range (-90, 90) or the query will throw
a QueryFailedException
.
NOTE: The $nearSphere
operator is not supported with
sharded clusters.
Only a single nearSphere(com.allanbank.mongodb.bson.DocumentAssignable)
comparison can be used. Calling
multiple nearSphere(...) methods overwrites previous values. In
addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
x
- The X coordinate to find documents near.y
- The Y coordinate to find documents near.public ConditionBuilder nearSphere(double x, double y, double maxDistance)
NOTE: The x must be within the range [-180, 180) and the
y values must be in the range (-90, 90) or the query will throw
a QueryFailedException
.
NOTE: The $nearSphere
operator is not supported with
sharded clusters.
Only a single nearSphere(com.allanbank.mongodb.bson.DocumentAssignable)
comparison can be used. Calling
multiple nearSphere(...) methods overwrites previous values. In
addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
x
- The X coordinate to find documents near.y
- The Y coordinate to find documents near.maxDistance
- Limits to documents returned to those within the specified
maximum distance.public ConditionBuilder nearSphere(int x, int y)
NOTE: The x must be within the range [-180, 180) and the
y values must be in the range (-90, 90) or the query will throw
a QueryFailedException
.
NOTE: The $nearSphere
operator is not supported with
sharded clusters.
Only a single nearSphere(com.allanbank.mongodb.bson.DocumentAssignable)
comparison can be used. Calling
multiple nearSphere(...) methods overwrites previous values. In
addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
x
- The X coordinate to find documents near.y
- The Y coordinate to find documents near.public ConditionBuilder nearSphere(int x, int y, int maxDistance)
NOTE: The x must be within the range [-180, 180) and the
y values must be in the range (-90, 90) or the query will throw
a QueryFailedException
.
NOTE: The $nearSphere
operator is not supported with
sharded clusters.
Only a single nearSphere(com.allanbank.mongodb.bson.DocumentAssignable)
comparison can be used. Calling
multiple nearSphere(...) methods overwrites previous values. In
addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
x
- The X coordinate to find documents near.y
- The Y coordinate to find documents near.maxDistance
- Limits to documents returned to those within the specified
maximum distance.public ConditionBuilder nearSphere(long x, long y)
NOTE: The x must be within the range [-180, 180) and the
y values must be in the range (-90, 90) or the query will throw
a QueryFailedException
.
NOTE: The $nearSphere
operator is not supported with
sharded clusters.
Only a single nearSphere(com.allanbank.mongodb.bson.DocumentAssignable)
comparison can be used. Calling
multiple nearSphere(...) methods overwrites previous values. In
addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
x
- The X coordinate to find documents near.y
- The Y coordinate to find documents near.public ConditionBuilder nearSphere(long x, long y, long maxDistance)
NOTE: The x must be within the range [-180, 180) and the
y values must be in the range (-90, 90) or the query will throw
a QueryFailedException
.
NOTE: The $nearSphere
operator is not supported with
sharded clusters.
Only a single nearSphere(com.allanbank.mongodb.bson.DocumentAssignable)
comparison can be used. Calling
multiple nearSphere(...) methods overwrites previous values. In
addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
x
- The X coordinate to find documents near.y
- The Y coordinate to find documents near.maxDistance
- Limits to documents returned to those within the specified
maximum distance.public ConditionBuilder notEqualTo(boolean value)
Only a single notEqualTo(...)
comparison can
be used. Calling multiple equals(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder notEqualTo(byte subType, byte[] value)
Only a single notEqualTo(...)
comparison can
be used. Calling multiple equals(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
subType
- The binary values subtype.value
- The value to compare the field against.public ConditionBuilder notEqualTo(byte[] value)
Only a single notEqualTo(...)
comparison can
be used. Calling multiple equals(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder notEqualTo(Date dateTime)
This is equivalent to notEqualToTimestamp(dateTime.getTime())
.
Only a single notEqualTo(...)
comparison can
be used. Calling multiple equals(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
dateTime
- The value to compare the field against.notEqualToTimestamp(long)
public ConditionBuilder notEqualTo(DocumentAssignable value)
Only a single notEqualTo(...)
comparison can
be used. Calling multiple equals(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder notEqualTo(double value)
Only a single notEqualTo(...)
comparison can
be used. Calling multiple equals(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder notEqualTo(int value)
Only a single notEqualTo(...)
comparison can
be used. Calling multiple equals(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder notEqualTo(long value)
Only a single notEqualTo(...)
comparison can
be used. Calling multiple equals(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder notEqualTo(ObjectId value)
Only a single notEqualTo(...)
comparison can
be used. Calling multiple equals(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder notEqualTo(Pattern value)
WARNING: Testing has shown that this query will throw a
QueryFailedException
.
Only a single notEqualTo(...)
comparison can
be used. Calling multiple equals(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.matches(Pattern)
public ConditionBuilder notEqualTo(String value)
Only a single notEqualTo(...)
comparison can
be used. Calling multiple equals(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder notEqualTo(UUID uuid)
Only a single notEqualTo(...)
comparison can
be used. Calling multiple equals(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
uuid
- The value to compare the field against.public ConditionBuilder notEqualToJavaScript(String value)
Only a single notEqualTo(...)
comparison can
be used. Calling multiple equals(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder notEqualToJavaScript(String value, DocumentAssignable scope)
NOTE: Testing has shown that the scope is ignored when performing the comparison.
Only a single notEqualTo(...)
comparison can
be used. Calling multiple equals(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.scope
- The stored scope value.public ConditionBuilder notEqualToLegacy(UUID uuid)
Only a single notEqualTo(...)
comparison can
be used. Calling multiple equals(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
uuid
- The value to compare the field against.public ConditionBuilder notEqualToMaxKey()
WARNING: Testing has shown that this query matches all documents
even if the value of the field is a ElementType.MIN_KEY
. This was
fixed in 2.6. See SERVER-11369.
Only a single notEqualTo(...)
comparison can
be used. Calling multiple equals(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
public ConditionBuilder notEqualToMinKey()
WARNING: Testing has shown that this query matches all documents
even if the value of the field is a ElementType.MIN_KEY
. This was
fixed in 2.6. See SERVER-11369.
Only a single notEqualTo(...)
comparison can
be used. Calling multiple equals(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
public ConditionBuilder notEqualToMongoTimestamp(long value)
Only a single notEqualTo(...)
comparison can
be used. Calling multiple equals(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder notEqualToNull()
Only a single notEqualTo(...)
comparison can
be used. Calling multiple equals(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
public ConditionBuilder notEqualToSymbol(String value)
Only a single notEqualTo(...)
comparison can
be used. Calling multiple equals(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder notEqualToTimestamp(long value)
Only a single notEqualTo(...)
comparison can
be used. Calling multiple equals(...)
methods
overwrites previous values. In addition any equals(...)
condition is removed since no equality operator is supported
by MongoDB.
value
- The value to compare the field against.public ConditionBuilder notIn(ArrayBuilder elements)
Only a single notIn(ArrayBuilder)
comparison can be used.
Calling multiple notIn(...) methods overwrites previous values.
In addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
elements
- A builder for the values for the comparison. Any changes to
the ArrayBuilder
after this method is called are not
reflected in the comparison.public ConditionBuilder notIn(boolean... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the notIn(Constant...)
method.ArrayBuilder
with the notIn(ArrayBuilder)
method.elements
and use the
notIn(Element...)
method.
Only a single notIn(ArrayBuilder)
comparison can be used.
Calling multiple notIn(...) methods overwrites previous values.
In addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder notIn(byte[]... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the notIn(Constant...)
method.ArrayBuilder
with the notIn(ArrayBuilder)
method.elements
and use the
notIn(Element...)
method.
Only a single notIn(ArrayBuilder)
comparison can be used.
Calling multiple notIn(...) methods overwrites previous values.
In addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder notIn(Constant... values)
This method is designed to be used with the Expressions.constant(...)
helper methods.
import static
com.allanbank.mongodb.builder.expression.Expressions.constant
; DocumentAssignable query = QueryBuilder.where("f").notIn(constant(1), constant(2), constant(3));
Only a single notIn(Element[])
comparison can be used. Calling
multiple notIn(...) methods overwrites previous values. In
addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder notIn(Date... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the notIn(Constant...)
method.ArrayBuilder
with the notIn(ArrayBuilder)
method.elements
and use the
notIn(Element...)
method.
Only a single notIn(ArrayBuilder)
comparison can be used.
Calling multiple notIn(...) methods overwrites previous values.
In addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder notIn(DocumentAssignable... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the notIn(Constant...)
method.ArrayBuilder
with the notIn(ArrayBuilder)
method.elements
and use the
notIn(Element...)
method.
Only a single notIn(ArrayBuilder)
comparison can be used.
Calling multiple notIn(...) methods overwrites previous values.
In addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder notIn(Double... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the notIn(Constant...)
method.ArrayBuilder
with the notIn(ArrayBuilder)
method.elements
and use the
notIn(Element...)
method.
Only a single notIn(ArrayBuilder)
comparison can be used.
Calling multiple notIn(...) methods overwrites previous values.
In addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder notIn(Element... elements)
Only a single notIn(Element[])
comparison can be used. Calling
multiple notIn(...) methods overwrites previous values. In
addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
elements
- The element values for the comparison.public ConditionBuilder notIn(Integer... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the notIn(Constant...)
method.ArrayBuilder
with the notIn(ArrayBuilder)
method.elements
and use the
notIn(Element...)
method.
Only a single notIn(ArrayBuilder)
comparison can be used.
Calling multiple notIn(...) methods overwrites previous values.
In addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder notIn(Long... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the notIn(Constant...)
method.ArrayBuilder
with the notIn(ArrayBuilder)
method.elements
and use the
notIn(Element...)
method.
Only a single notIn(ArrayBuilder)
comparison can be used.
Calling multiple notIn(...) methods overwrites previous values.
In addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder notIn(ObjectId... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the notIn(Constant...)
method.ArrayBuilder
with the notIn(ArrayBuilder)
method.elements
and use the
notIn(Element...)
method.
Only a single notIn(ArrayBuilder)
comparison can be used.
Calling multiple notIn(...) methods overwrites previous values.
In addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder notIn(Pattern... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the notIn(Constant...)
method.ArrayBuilder
with the notIn(ArrayBuilder)
method.elements
and use the
notIn(Element...)
method.
Only a single notIn(ArrayBuilder)
comparison can be used.
Calling multiple notIn(...) methods overwrites previous values.
In addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder notIn(String... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the notIn(Constant...)
method.ArrayBuilder
with the notIn(ArrayBuilder)
method.elements
and use the
notIn(Element...)
method.
Only a single notIn(ArrayBuilder)
comparison can be used.
Calling multiple notIn(...) methods overwrites previous values.
In addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
values
- The values for the comparison.public ConditionBuilder notIn(UUID... values)
This method can only be used with values of the same BSON type. If mixed types need to be used there are several options:
Expressions#constant(...)
helpers with the notIn(Constant...)
method.ArrayBuilder
with the notIn(ArrayBuilder)
method.elements
and use the
notIn(Element...)
method.
Only a single notIn(ArrayBuilder)
comparison can be used.
Calling multiple notIn(...) methods overwrites previous values.
In addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
values
- The values for the comparison.public void reset()
public ConditionBuilder size(int length)
Only a single lessThan(...)
comparison can be used.
Calling multiple size(int) methods overwrites previous values.
In addition any equals(...)
condition is removed
since no equality operator is supported by MongoDB.
length
- The value to compare the field's length against.public ConditionBuilder text(String textSearchExpression)
Note that the $text
operator does not
apply to a specific field but applies to the document as a whole. For
this reason only a single text(java.lang.String)
condition can be used. Calling
multiple text(...) methods overwrites previous values.
textSearchExpression
- The text search expression.public ConditionBuilder text(String textSearchExpression, String language)
Note that the $text
operator does not
apply to a specific field but applies to the document as a whole. For
this reason only a single text(java.lang.String)
condition can be used. Calling
multiple text(...) methods overwrites previous values.
textSearchExpression
- The text search expression.language
- The language of the text search expression.public ConditionBuilder where(String javaScript)
Note that the $where
operator does
not apply to a specific field but applies to the document as a whole. For
this reason only a single where(String)
condition can be used.
Calling multiple where(...) methods overwrites previous values.
javaScript
- The javaScript condition to add.@Deprecated public ConditionBuilder within(boolean uniqueDocs, Point2D p1, Point2D p2, Point2D p3, Point2D... points)
$uniqueDocs
was removed in MongoDB 2.6. This method
will not be removed until two releases after the MongoDB 2.6
release (e.g. 2.10 if the releases are 2.8 and 2.10).
NOTE: The x and y values must be in the range
[-180, 180) or the query will throw a QueryFailedException
.
Only a single within(boolean, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D...)
comparison can be used. Calling multiple
within(...) methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
uniqueDocs
- Controls if documents are returned multiple times for multiple
matching conditions.p1
- The first point defining the bounds of the polygon.p2
- The second point defining the bounds of the polygon.p3
- The third point defining the bounds of the polygon.points
- The remaining points in the polygon.public ConditionBuilder within(DocumentAssignable geoJsonDoc)
GeoJSON
specified geometry.
This method is designed to be use with a GeoJSON document constructed
with the GeoJson
class
where
("geo").within(GeoJson.lineString
(GeoJson.p
(1,2),GeoJson.p
(10,11) ) );
NOTE: The $within
operator with a GeoJSON document
requires a 2dsphere
index.
Only a single within(boolean, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D...)
comparison can be used. Calling multiple
within(...) methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
geoJsonDoc
- The GeoJSON document describing the geometry.@Deprecated public ConditionBuilder within(DocumentAssignable geoJsonDoc, boolean uniqueDocs)
$uniqueDocs
was removed in MongoDB 2.6. This method
will not be removed until two releases after the MongoDB 2.6
release (e.g. 2.10 if the releases are 2.8 and 2.10).GeoJSON
specified geometry.
This method is designed to be use with a GeoJSON document constructed
with the GeoJson
class
where
("geo").within(GeoJson.lineString
(GeoJson.p
(1,2),GeoJson.p
(10,11) ), true );
NOTE: The $within
operator with a GeoJSON document
requires a 2dsphere
index.
Only a single within(boolean, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D...)
comparison can be used. Calling multiple
within(...) methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
geoJsonDoc
- The GeoJSON document describing the geometry.uniqueDocs
- Controls if documents are returned multiple times for multiple
matching conditions.public ConditionBuilder within(double x, double y, double radius)
NOTE: The x and y values must be in the range
[-180, 180) or the query will throw a QueryFailedException
.
Only a single within(boolean, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D...)
comparison can be used. Calling multiple
within(...) methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
x
- The X coordinate for the center of the circle.y
- The Y coordinate for the center of the circle.radius
- The radius of the circle.@Deprecated public ConditionBuilder within(double x, double y, double radius, boolean uniqueDocs)
$uniqueDocs
was removed in MongoDB 2.6. This method
will not be removed until two releases after the MongoDB 2.6
release (e.g. 2.10 if the releases are 2.8 and 2.10).
NOTE: The x and y values must be in the range
[-180, 180) or the query will throw a QueryFailedException
.
Only a single within(boolean, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D...)
comparison can be used. Calling multiple
within(...) methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
x
- The X coordinate for the center of the circle.y
- The Y coordinate for the center of the circle.radius
- The radius of the circle.uniqueDocs
- Controls if documents are returned multiple times for multiple
matching conditions.public ConditionBuilder within(double x1, double y1, double x2, double y2)
NOTE: The x and y values must be in the range
[-180, 180) or the query will throw a QueryFailedException
.
Only a single within(boolean, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D...)
comparison can be used. Calling multiple
within(...) methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
x1
- The first X coordinate.y1
- The first Y coordinate.x2
- The second X coordinate. NOT THE WIDTH.y2
- The second Y coordinate. NOT THE HEIGHT.@Deprecated public ConditionBuilder within(double x1, double y1, double x2, double y2, boolean uniqueDocs)
$uniqueDocs
was removed in MongoDB 2.6. This method
will not be removed until two releases after the MongoDB 2.6
release (e.g. 2.10 if the releases are 2.8 and 2.10).
NOTE: The x and y values must be in the range
[-180, 180) or the query will throw a QueryFailedException
.
Only a single within(boolean, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D...)
comparison can be used. Calling multiple
within(...) methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
x1
- The first X coordinate.y1
- The first Y coordinate.x2
- The second X coordinate. NOT THE WIDTH.y2
- The second Y coordinate. NOT THE HEIGHT.uniqueDocs
- Controls if documents are returned multiple times for multiple
matching conditions.public ConditionBuilder within(int x, int y, int radius)
NOTE: The x and y values must be in the range
[-180, 180) or the query will throw a QueryFailedException
.
Only a single within(boolean, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D...)
comparison can be used. Calling multiple
within(...) methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
x
- The X coordinate for the center of the circle.y
- The Y coordinate for the center of the circle.radius
- The radius of the circle.@Deprecated public ConditionBuilder within(int x, int y, int radius, boolean uniqueDocs)
$uniqueDocs
was removed in MongoDB 2.6. This method
will not be removed until two releases after the MongoDB 2.6
release (e.g. 2.10 if the releases are 2.8 and 2.10).
NOTE: The x and y values must be in the range
[-180, 180) or the query will throw a QueryFailedException
.
Only a single within(boolean, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D...)
comparison can be used. Calling multiple
within(...) methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
x
- The X coordinate for the center of the circle.y
- The Y coordinate for the center of the circle.radius
- The radius of the circle.uniqueDocs
- Controls if documents are returned multiple times for multiple
matching conditions.public ConditionBuilder within(int x1, int y1, int x2, int y2)
NOTE: The x and y values must be in the range
[-180, 180) or the query will throw a QueryFailedException
.
Only a single within(boolean, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D...)
comparison can be used. Calling multiple
within(...) methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
x1
- The first X coordinate.y1
- The first Y coordinate.x2
- The second X coordinate. NOT THE WIDTH.y2
- The second Y coordinate. NOT THE HEIGHT.@Deprecated public ConditionBuilder within(int x1, int y1, int x2, int y2, boolean uniqueDocs)
$uniqueDocs
was removed in MongoDB 2.6. This method
will not be removed until two releases after the MongoDB 2.6
release (e.g. 2.10 if the releases are 2.8 and 2.10).
NOTE: The x and y values must be in the range
[-180, 180) or the query will throw a QueryFailedException
.
Only a single within(boolean, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D...)
comparison can be used. Calling multiple
within(...) methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
x1
- The first X coordinate.y1
- The first Y coordinate.x2
- The second X coordinate. NOT THE WIDTH.y2
- The second Y coordinate. NOT THE HEIGHT.uniqueDocs
- Controls if documents are returned multiple times for multiple
matching conditions.public ConditionBuilder within(long x, long y, long radius)
NOTE: The x and y values must be in the range
[-180, 180) or the query will throw a QueryFailedException
.
Only a single within(boolean, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D...)
comparison can be used. Calling multiple
within(...) methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
x
- The X coordinate for the center of the circle.y
- The Y coordinate for the center of the circle.radius
- The radius of the circle.@Deprecated public ConditionBuilder within(long x, long y, long radius, boolean uniqueDocs)
$uniqueDocs
was removed in MongoDB 2.6. This method
will not be removed until two releases after the MongoDB 2.6
release (e.g. 2.10 if the releases are 2.8 and 2.10).
NOTE: The x and y values must be in the range
[-180, 180) or the query will throw a QueryFailedException
.
Only a single within(boolean, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D...)
comparison can be used. Calling multiple
within(...) methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
x
- The X coordinate for the center of the circle.y
- The Y coordinate for the center of the circle.radius
- The radius of the circle.uniqueDocs
- Controls if documents are returned multiple times for multiple
matching conditions.public ConditionBuilder within(long x1, long y1, long x2, long y2)
NOTE: The x and y values must be in the range
[-180, 180) or the query will throw a QueryFailedException
.
Only a single within(boolean, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D...)
comparison can be used. Calling multiple
within(...) methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
x1
- The first X coordinate.y1
- The first Y coordinate.x2
- The second X coordinate. NOT THE WIDTH.y2
- The second Y coordinate. NOT THE HEIGHT.@Deprecated public ConditionBuilder within(long x1, long y1, long x2, long y2, boolean uniqueDocs)
$uniqueDocs
was removed in MongoDB 2.6. This method
will not be removed until two releases after the MongoDB 2.6
release (e.g. 2.10 if the releases are 2.8 and 2.10).
NOTE: The x and y values must be in the range
[-180, 180) or the query will throw a QueryFailedException
.
Only a single within(boolean, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D...)
comparison can be used. Calling multiple
within(...) methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
x1
- The first X coordinate.y1
- The first Y coordinate.x2
- The second X coordinate. NOT THE WIDTH.y2
- The second Y coordinate. NOT THE HEIGHT.uniqueDocs
- Controls if documents are returned multiple times for multiple
matching conditions.public ConditionBuilder within(Point2D p1, Point2D p2, Point2D p3, Point2D... points)
NOTE: The x and y values must be in the range
[-180, 180) or the query will throw a QueryFailedException
.
Only a single within(boolean, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D...)
comparison can be used. Calling multiple
within(...) methods overwrites previous values. In addition any
equals(...)
condition is removed since no
equality operator is supported by MongoDB.
p1
- The first point defining the bounds of the polygon.p2
- The second point defining the bounds of the polygon.p3
- The third point defining the bounds of the polygon.points
- The remaining points in the polygon.public ConditionBuilder withinOnSphere(double x, double y, double radius)
NOTE: The x must be within the range [-180, 180) and the
y values must be in the range (-90, 90) or the query will throw
a QueryFailedException
.
NOTE 2: The x, y and radius must not wrap since that has not been implemented yet within MongoDB.
Only a single within(boolean, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D...)
comparison can be used. Calling multiple
withinXXX(...) methods overwrites previous values. In addition
any equals(...)
condition is removed since no
equality operator is supported by MongoDB.
x
- The X coordinate for the center of the circle.y
- The Y coordinate for the center of the circle.radius
- The radius of the circle.@Deprecated public ConditionBuilder withinOnSphere(double x, double y, double radius, boolean uniqueDocs)
$uniqueDocs
was removed in MongoDB 2.6. This method
will not be removed until two releases after the MongoDB 2.6
release (e.g. 2.10 if the releases are 2.8 and 2.10).
NOTE: The x must be within the range [-180, 180) and the
y values must be in the range (-90, 90) or the query will throw
a QueryFailedException
.
NOTE 2: The x, y and radius must not wrap since that has not been implemented yet within MongoDB.
Only a single within(boolean, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D...)
comparison can be used. Calling multiple
withinXXX(...) methods overwrites previous values. In addition
any equals(...)
condition is removed since no
equality operator is supported by MongoDB.
x
- The X coordinate for the center of the circle.y
- The Y coordinate for the center of the circle.radius
- The radius of the circle.uniqueDocs
- Controls if documents are returned multiple times for multiple
matching conditions.public ConditionBuilder withinOnSphere(int x, int y, int radius)
NOTE: The x must be within the range [-180, 180) and the
y values must be in the range (-90, 90) or the query will throw
a QueryFailedException
.
NOTE 2: The x, y and radius must not wrap since that has not been implemented yet within MongoDB.
Only a single within(boolean, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D...)
comparison can be used. Calling multiple
withinXXX(...) methods overwrites previous values. In addition
any equals(...)
condition is removed since no
equality operator is supported by MongoDB.
x
- The X coordinate for the center of the circle.y
- The Y coordinate for the center of the circle.radius
- The radius of the circle.@Deprecated public ConditionBuilder withinOnSphere(int x, int y, int radius, boolean uniqueDocs)
$uniqueDocs
was removed in MongoDB 2.6. This method
will not be removed until two releases after the MongoDB 2.6
release (e.g. 2.10 if the releases are 2.8 and 2.10).
NOTE: The x must be within the range [-180, 180) and the
y values must be in the range (-90, 90) or the query will throw
a QueryFailedException
.
NOTE 2: The x, y and radius must not wrap since that has not been implemented yet within MongoDB.
Only a single within(boolean, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D...)
comparison can be used. Calling multiple
withinXXX(...) methods overwrites previous values. In addition
any equals(...)
condition is removed since no
equality operator is supported by MongoDB.
x
- The X coordinate for the center of the circle.y
- The Y coordinate for the center of the circle.radius
- The radius of the circle.uniqueDocs
- Controls if documents are returned multiple times for multiple
matching conditions.public ConditionBuilder withinOnSphere(long x, long y, long radius)
NOTE: The x must be within the range [-180, 180) and the
y values must be in the range (-90, 90) or the query will throw
a QueryFailedException
.
NOTE 2: The x, y and radius must not wrap since that has not been implemented yet within MongoDB.
Only a single within(boolean, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D...)
comparison can be used. Calling multiple
withinXXX(...) methods overwrites previous values. In addition
any equals(...)
condition is removed since no
equality operator is supported by MongoDB.
x
- The X coordinate for the center of the circle.y
- The Y coordinate for the center of the circle.radius
- The radius of the circle.@Deprecated public ConditionBuilder withinOnSphere(long x, long y, long radius, boolean uniqueDocs)
$uniqueDocs
was removed in MongoDB 2.6. This method
will not be removed until two releases after the MongoDB 2.6
release (e.g. 2.10 if the releases are 2.8 and 2.10).
NOTE: The x must be within the range [-180, 180) and the
y values must be in the range (-90, 90) or the query will throw
a QueryFailedException
.
NOTE 2: The x, y and radius must not wrap since that has not been implemented yet within MongoDB.
Only a single within(boolean, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D, java.awt.geom.Point2D...)
comparison can be used. Calling multiple
withinXXX(...) methods overwrites previous values. In addition
any equals(...)
condition is removed since no
equality operator is supported by MongoDB.
x
- The X coordinate for the center of the circle.y
- The Y coordinate for the center of the circle.radius
- The radius of the circle.uniqueDocs
- Controls if documents are returned multiple times for multiple
matching conditions.Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.