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. | 
| AggregationGroupField | AggregationGroupField holds the information for an aggregation field in an
 aggregate command's
  $grouppipeline 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
  $grouppipeline 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
  $projectpipeline 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  Distinctobject. | 
| Find | Find provides an immutable container for all of the options for a query. | 
| Find.Builder | Helper for creating immutable  Findqueries. | 
| FindAndModify | Represents the state of a single  MongoCollection.findAndModify(com.allanbank.mongodb.builder.FindAndModify)command. | 
| FindAndModify.Builder | Helper for creating immutable  FindAndModifycommands. | 
| GroupBy | Group provides a container for all of the options to a group
 command. | 
| GroupBy.Builder | Builder provides a builder for Group commands. | 
| MapReduce | Represents the state of a single  MongoCollection.mapReduce(com.allanbank.mongodb.builder.MapReduce)command. | 
| MapReduce.Builder | Helper for creating immutable  MapReducecommands. | 
| QueryBuilder | QueryBuilder provides support for constructing queries. | 
| Sort | Provides the ability to easily specify the sort direction for an index or
 sort specification. | 
| 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 staticcom.allanbank.mongodb.builder.QueryBuilder.andimport staticcom.allanbank.mongodb.builder.QueryBuilder.orimport staticcom.allanbank.mongodb.builder.QueryBuilder.notimport staticcom.allanbank.mongodb.builder.QueryBuilder.whereDocument 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.