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. |
BatchedWrite |
BatchedWrite provides a container for a group of write operations to be sent
to the server as one group.
|
BatchedWrite.Builder |
Builder for creating
BatchedWrite s. |
BatchedWrite.Bundle |
Bundle is a container for the write command and the
WriteOperation it contains. |
ConditionBuilder |
ConditionBuilder provides tracking for the condition of a single field within
a query.
|
Count |
Count provides an immutable container for all of the options for a query to
count documents.
|
Count.Builder |
Helper for creating immutable
Count queries. |
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. |
ParallelScan |
ParallelScan provides an immutable container for all of the options for a
parallelCollectionScan . |
ParallelScan.Builder |
Helper for creating immutable
ParallelScan queries. |
QueryBuilder |
QueryBuilder provides support for constructing queries.
|
Sort |
Provides the ability to easily specify the sort direction for an index or
sort specification.
|
Text | Deprecated
Support for the
text command was deprecated in the 2.6
version of MongoDB. |
Text.Builder | Deprecated
Support for the
text command was deprecated in the
2.6 version of MongoDB. |
TextResult | Deprecated
Support for the
text command was deprecated in the 2.6
version of MongoDB. |
Enum | Description |
---|---|
BatchedWriteMode |
BatchedWriteMode provides enumeration of the available modes for submitting
the batched writes.
|
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.
|
RedactOption |
RedactOption provides options for what to do when evaluating a
$redact condition within the Aggregate pipeline. |
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–2014 Allanbank Consulting, Inc.. All rights reserved.