See: Description
Interface | Description |
---|---|
Operator |
Operator provides an enumeration of all possible operators.
|
Class | Description |
---|---|
Aggregate |
Aggregate provides support for the aggregate command supporting a
pipeline of commands to execute.
|
Aggregate.Builder |
Builder provides the ability to construct aggregate command pipelines.
|
AggregationGeoNear |
AggregationGeoNear provides the options for the
$geoNear pipeline
stage of an aggregation. |
AggregationGeoNear.Builder |
Helper for creating immutable
Find queries. |
AggregationGroupField |
AggregationGroupField holds the information for an aggregation field in an
aggregate command's
$group pipeline operator. |
AggregationGroupField.Builder |
Builder provides the ability to construct a
AggregationGroupField
. |
AggregationGroupId |
AggregationGroupId holds the information for the _id field in an
aggregate command's
$group pipeline operator. |
AggregationGroupId.Builder |
Builder provides the ability to construct a complex
AggregationGroupId . |
AggregationProjectFields |
AggregationProjectFields holds the information for the fields to copy from
the input documents when using the aggregate command's
$project pipeline operator. |
ConditionBuilder |
ConditionBuilder provides tracking for the condition of a single field within
a query.
|
Distinct |
Distinct provides container for all of the options to a distinct
command.
|
Distinct.Builder |
Builder provides support for creating a
Distinct object. |
Find |
Find provides an immutable container for all of the options for a query.
|
Find.Builder |
Helper for creating immutable
Find queries. |
FindAndModify |
Represents the state of a single
MongoCollection.findAndModify(com.allanbank.mongodb.builder.FindAndModify)
command. |
FindAndModify.Builder |
Helper for creating immutable
FindAndModify commands. |
GeoJson |
GeoJson provides static methods to help create GeoJSON BSON Documents.
|
GroupBy |
Group provides a container for all of the options to a group
command.
|
GroupBy.Builder |
Builder provides a builder for Group commands.
|
Index |
Provides the ability to easily specify the index type of a field within an
index specification.
|
MapReduce |
Represents the state of a single
MongoCollection.mapReduce(com.allanbank.mongodb.builder.MapReduce) command. |
MapReduce.Builder |
Helper for creating immutable
MapReduce commands. |
QueryBuilder |
QueryBuilder provides support for constructing queries.
|
Sort |
Provides the ability to easily specify the sort direction for an index or
sort specification.
|
Text |
Text provides a wrapper for a
text command to query a collection with
a text index . |
Text.Builder |
Builder provides a builder for Text commands.
|
TextResult |
TextResult provides a wrapper for a single result of a
text
command. |
Enum | Description |
---|---|
ComparisonOperator |
ComparisonOperator provides an enumeration of all possible comparison
operators.
|
GeospatialOperator |
GeospatialOperator provides the enumeration of geospatial operators.
|
LogicalOperator |
LogicalOperator provides the set of logical operators.
|
MapReduce.OutputType |
Enumeration of the possible output types.
|
MiscellaneousOperator |
MiscellaneousOperator provides the set of miscellaneous operators.
|
To construct a query using the builder use the static methods of the QueryBuilder class and then add conditions for fields. As an example:
import static
com.allanbank.mongodb.builder.QueryBuilder.and
import staticcom.allanbank.mongodb.builder.QueryBuilder.or
import staticcom.allanbank.mongodb.builder.QueryBuilder.not
import staticcom.allanbank.mongodb.builder.QueryBuilder.where
Document query = or( where("f").greaterThan(23).lessThan(42).and("g").lessThan(3), and( where("f").greaterThanOrEqualTo(42), not( where("g").lessThan(3) ) ) );
Each of the commands classes is immutable but has an inner static Builder class that can be used to construct the command object.
For Example:
GroupBy.Builder builder = new GroupBy.Builder(); builder.setKeys(Collections.singletonSet("key")); GroupBy command = builder.build();
Copyright © 2011-2013 Allanbank Consulting, Inc.. All Rights Reserved.