Package | Description |
---|---|
com.mongodb |
This package is the main entry point to the MongoDB Java Driver, and it contains the classes for the existing API from 2.x versions.
|
com.mongodb.async.client |
This packages contains classes for the new async client
|
com.mongodb.client |
This package contains client interfaces
|
com.mongodb.client.gridfs |
This package contains the new GridFS implementation
|
com.mongodb.client.model |
This package contains models and options that help describe MongoCollection operations
|
org.bson |
This package contains bson classes required for the driver
|
Modifier and Type | Class and Description |
---|---|
class |
BasicDBObject
A basic implementation of BSON object that is MongoDB specific.
|
class |
CommandResult
A simple wrapper to hold the result of a command.
|
Modifier and Type | Method and Description |
---|---|
void |
MongoCollection.count(Bson filter,
CountOptions options,
SingleResultCallback<Long> callback)
Counts the number of documents in the collection according to the given options.
|
void |
MongoCollection.count(Bson filter,
SingleResultCallback<Long> callback)
Counts the number of documents in the collection according to the given options.
|
void |
MongoCollection.createIndex(Bson key,
IndexOptions options,
SingleResultCallback<String> callback)
Creates an index.
|
void |
MongoCollection.createIndex(Bson key,
SingleResultCallback<String> callback)
Creates an index.
|
void |
MongoCollection.deleteMany(Bson filter,
SingleResultCallback<DeleteResult> callback)
Removes all documents from the collection that match the given query filter.
|
void |
MongoCollection.deleteOne(Bson filter,
SingleResultCallback<DeleteResult> callback)
Removes at most one document from the collection that matches the given filter.
|
<TResult> DistinctIterable<TResult> |
MongoCollection.distinct(String fieldName,
Bson filter,
Class<TResult> resultClass)
Gets the distinct values of the specified field name.
|
void |
MongoCollection.dropIndex(Bson keys,
SingleResultCallback<Void> callback)
Drops the index given the keys used to create it.
|
DistinctIterable<TResult> |
DistinctIterable.filter(Bson filter)
Sets the query filter to apply to the query.
|
FindIterable<T> |
FindIterable.filter(Bson filter)
Sets the query filter to apply to the query.
|
MapReduceIterable<TResult> |
MapReduceIterable.filter(Bson filter)
Sets the query filter to apply to the query.
|
ListCollectionsIterable<TResult> |
ListCollectionsIterable.filter(Bson filter)
Sets the query filter to apply to the query.
|
FindIterable<TDocument> |
MongoCollection.find(Bson filter)
Finds all documents in the collection.
|
<TResult> FindIterable<TResult> |
MongoCollection.find(Bson filter,
Class<TResult> resultClass)
Finds all documents in the collection.
|
void |
MongoCollection.findOneAndDelete(Bson filter,
FindOneAndDeleteOptions options,
SingleResultCallback<TDocument> callback)
Atomically find a document and remove it.
|
void |
MongoCollection.findOneAndDelete(Bson filter,
SingleResultCallback<TDocument> callback)
Atomically find a document and remove it.
|
void |
MongoCollection.findOneAndReplace(Bson filter,
TDocument replacement,
FindOneAndReplaceOptions options,
SingleResultCallback<TDocument> callback)
Atomically find a document and replace it.
|
void |
MongoCollection.findOneAndReplace(Bson filter,
TDocument replacement,
SingleResultCallback<TDocument> callback)
Atomically find a document and replace it.
|
void |
MongoCollection.findOneAndUpdate(Bson filter,
Bson update,
FindOneAndUpdateOptions options,
SingleResultCallback<TDocument> callback)
Atomically find a document and update it.
|
void |
MongoCollection.findOneAndUpdate(Bson filter,
Bson update,
SingleResultCallback<TDocument> callback)
Atomically find a document and update it.
|
FindIterable<T> |
FindIterable.modifiers(Bson modifiers)
Sets the query modifiers to apply to this operation.
|
FindIterable<T> |
FindIterable.projection(Bson projection)
Sets a document describing the fields to return for all matching documents.
|
void |
MongoCollection.replaceOne(Bson filter,
TDocument replacement,
SingleResultCallback<UpdateResult> callback)
Replace a document in the collection according to the specified arguments.
|
void |
MongoCollection.replaceOne(Bson filter,
TDocument replacement,
UpdateOptions options,
SingleResultCallback<UpdateResult> callback)
Replace a document in the collection according to the specified arguments.
|
<TResult> void |
MongoDatabase.runCommand(Bson command,
Class<TResult> resultClass,
SingleResultCallback<TResult> callback)
Executes the given command in the context of the current database with a read preference of
ReadPreference.primary() . |
<TResult> void |
MongoDatabase.runCommand(Bson command,
ReadPreference readPreference,
Class<TResult> resultClass,
SingleResultCallback<TResult> callback)
Executes the given command in the context of the current database with the given read preference.
|
void |
MongoDatabase.runCommand(Bson command,
ReadPreference readPreference,
SingleResultCallback<Document> callback)
Executes the given command in the context of the current database with the given read preference.
|
void |
MongoDatabase.runCommand(Bson command,
SingleResultCallback<Document> callback)
Executes the given command in the context of the current database with a read preference of
ReadPreference.primary() . |
MapReduceIterable<TResult> |
MapReduceIterable.scope(Bson scope)
Sets the global variables that are accessible in the map, reduce and finalize functions.
|
FindIterable<T> |
FindIterable.sort(Bson sort)
Sets the sort criteria to apply to the query.
|
MapReduceIterable<TResult> |
MapReduceIterable.sort(Bson sort)
Sets the sort criteria to apply to the query.
|
void |
MongoCollection.updateMany(Bson filter,
Bson update,
SingleResultCallback<UpdateResult> callback)
Update all documents in the collection according to the specified arguments.
|
void |
MongoCollection.updateMany(Bson filter,
Bson update,
UpdateOptions options,
SingleResultCallback<UpdateResult> callback)
Update all documents in the collection according to the specified arguments.
|
void |
MongoCollection.updateOne(Bson filter,
Bson update,
SingleResultCallback<UpdateResult> callback)
Update a single document in the collection according to the specified arguments.
|
void |
MongoCollection.updateOne(Bson filter,
Bson update,
UpdateOptions options,
SingleResultCallback<UpdateResult> callback)
Update a single document in the collection according to the specified arguments.
|
Modifier and Type | Method and Description |
---|---|
AggregateIterable<TDocument> |
MongoCollection.aggregate(List<? extends Bson> pipeline)
Aggregates documents according to the specified aggregation pipeline.
|
<TResult> AggregateIterable<TResult> |
MongoCollection.aggregate(List<? extends Bson> pipeline,
Class<TResult> resultClass)
Aggregates documents according to the specified aggregation pipeline.
|
Modifier and Type | Method and Description |
---|---|
long |
MongoCollection.count(Bson filter)
Counts the number of documents in the collection according to the given options.
|
long |
MongoCollection.count(Bson filter,
CountOptions options)
Counts the number of documents in the collection according to the given options.
|
String |
MongoCollection.createIndex(Bson keys)
Create an index with the given keys.
|
String |
MongoCollection.createIndex(Bson keys,
IndexOptions indexOptions)
Create an index with the given keys and options.
|
DeleteResult |
MongoCollection.deleteMany(Bson filter)
Removes all documents from the collection that match the given query filter.
|
DeleteResult |
MongoCollection.deleteOne(Bson filter)
Removes at most one document from the collection that matches the given filter.
|
<TResult> DistinctIterable<TResult> |
MongoCollection.distinct(String fieldName,
Bson filter,
Class<TResult> resultClass)
Gets the distinct values of the specified field name.
|
void |
MongoCollection.dropIndex(Bson keys)
Drops the index given the keys used to create it.
|
ListCollectionsIterable<TResult> |
ListCollectionsIterable.filter(Bson filter)
Sets the query filter to apply to the query.
|
DistinctIterable<TResult> |
DistinctIterable.filter(Bson filter)
Sets the query filter to apply to the query.
|
FindIterable<TResult> |
FindIterable.filter(Bson filter)
Sets the query filter to apply to the query.
|
MapReduceIterable<TResult> |
MapReduceIterable.filter(Bson filter)
Sets the query filter to apply to the query.
|
FindIterable<TDocument> |
MongoCollection.find(Bson filter)
Finds all documents in the collection.
|
<TResult> FindIterable<TResult> |
MongoCollection.find(Bson filter,
Class<TResult> resultClass)
Finds all documents in the collection.
|
TDocument |
MongoCollection.findOneAndDelete(Bson filter)
Atomically find a document and remove it.
|
TDocument |
MongoCollection.findOneAndDelete(Bson filter,
FindOneAndDeleteOptions options)
Atomically find a document and remove it.
|
TDocument |
MongoCollection.findOneAndReplace(Bson filter,
TDocument replacement)
Atomically find a document and replace it.
|
TDocument |
MongoCollection.findOneAndReplace(Bson filter,
TDocument replacement,
FindOneAndReplaceOptions options)
Atomically find a document and replace it.
|
TDocument |
MongoCollection.findOneAndUpdate(Bson filter,
Bson update)
Atomically find a document and update it.
|
TDocument |
MongoCollection.findOneAndUpdate(Bson filter,
Bson update,
FindOneAndUpdateOptions options)
Atomically find a document and update it.
|
FindIterable<TResult> |
FindIterable.modifiers(Bson modifiers)
Sets the query modifiers to apply to this operation.
|
FindIterable<TResult> |
FindIterable.projection(Bson projection)
Sets a document describing the fields to return for all matching documents.
|
UpdateResult |
MongoCollection.replaceOne(Bson filter,
TDocument replacement)
Replace a document in the collection according to the specified arguments.
|
UpdateResult |
MongoCollection.replaceOne(Bson filter,
TDocument replacement,
UpdateOptions updateOptions)
Replace a document in the collection according to the specified arguments.
|
Document |
MongoDatabase.runCommand(Bson command)
Executes the given command in the context of the current database with a read preference of
ReadPreference.primary() . |
<TResult> TResult |
MongoDatabase.runCommand(Bson command,
Class<TResult> resultClass)
Executes the given command in the context of the current database with a read preference of
ReadPreference.primary() . |
Document |
MongoDatabase.runCommand(Bson command,
ReadPreference readPreference)
Executes the given command in the context of the current database with the given read preference.
|
<TResult> TResult |
MongoDatabase.runCommand(Bson command,
ReadPreference readPreference,
Class<TResult> resultClass)
Executes the given command in the context of the current database with the given read preference.
|
MapReduceIterable<TResult> |
MapReduceIterable.scope(Bson scope)
Sets the global variables that are accessible in the map, reduce and finalize functions.
|
FindIterable<TResult> |
FindIterable.sort(Bson sort)
Sets the sort criteria to apply to the query.
|
MapReduceIterable<TResult> |
MapReduceIterable.sort(Bson sort)
Sets the sort criteria to apply to the query.
|
UpdateResult |
MongoCollection.updateMany(Bson filter,
Bson update)
Update all documents in the collection according to the specified arguments.
|
UpdateResult |
MongoCollection.updateMany(Bson filter,
Bson update,
UpdateOptions updateOptions)
Update all documents in the collection according to the specified arguments.
|
UpdateResult |
MongoCollection.updateOne(Bson filter,
Bson update)
Update a single document in the collection according to the specified arguments.
|
UpdateResult |
MongoCollection.updateOne(Bson filter,
Bson update,
UpdateOptions updateOptions)
Update a single document in the collection according to the specified arguments.
|
Modifier and Type | Method and Description |
---|---|
AggregateIterable<TDocument> |
MongoCollection.aggregate(List<? extends Bson> pipeline)
Aggregates documents according to the specified aggregation pipeline.
|
<TResult> AggregateIterable<TResult> |
MongoCollection.aggregate(List<? extends Bson> pipeline,
Class<TResult> resultClass)
Aggregates documents according to the specified aggregation pipeline.
|
Modifier and Type | Method and Description |
---|---|
GridFSFindIterable |
GridFSFindIterable.filter(Bson filter)
Sets the query filter to apply to the query.
|
GridFSFindIterable |
GridFSBucket.find(Bson filter)
Finds all documents in the collection that match the filter.
|
GridFSFindIterable |
GridFSFindIterable.sort(Bson sort)
Sets the sort criteria to apply to the query.
|
Modifier and Type | Method and Description |
---|---|
static <TItem> Bson |
Updates.addEachToSet(String fieldName,
List<TItem> values)
Creates an update that adds each of the given values to the array value of the field with the given name, unless the value is
already present, in which case it does nothing
|
static <TItem> Bson |
Updates.addToSet(String fieldName,
TItem value)
Creates an update that adds the given value to the array value of the field with the given name, unless the value is
already present, in which case it does nothing
|
static <TItem> Bson |
Filters.all(String fieldName,
Iterable<TItem> values)
Creates a filter that matches all documents where the value of a field is an array that contains all the specified values.
|
static <TItem> Bson |
Filters.all(String fieldName,
TItem... values)
Creates a filter that matches all documents where the value of a field is an array that contains all the specified values.
|
static Bson |
Filters.and(Bson... filters)
Creates a filter that performs a logical AND of the provided list of filters.
|
static Bson |
Filters.and(Iterable<Bson> filters)
Creates a filter that performs a logical AND of the provided list of filters.
|
static Bson |
Indexes.ascending(List<String> fieldNames)
Create an index key for an ascending index on the given fields.
|
static Bson |
Sorts.ascending(List<String> fieldNames)
Create a sort specification for an ascending sort on the given fields.
|
static Bson |
Indexes.ascending(String... fieldNames)
Create an index key for an ascending index on the given fields.
|
static Bson |
Sorts.ascending(String... fieldNames)
Create a sort specification for an ascending sort on the given fields.
|
static Bson |
Filters.bitsAllClear(String fieldName,
long bitmask)
Creates a filter that matches all documents where all of the bit positions are clear in the field.
|
static Bson |
Filters.bitsAllSet(String fieldName,
long bitmask)
Creates a filter that matches all documents where all of the bit positions are set in the field.
|
static Bson |
Filters.bitsAnyClear(String fieldName,
long bitmask)
Creates a filter that matches all documents where any of the bit positions are clear in the field.
|
static Bson |
Filters.bitsAnySet(String fieldName,
long bitmask)
Creates a filter that matches all documents where any of the bit positions are set in the field.
|
static Bson |
Updates.bitwiseAnd(String fieldName,
int value)
Creates an update that performs a bitwise and between the given integer value and the integral value of the field with the given
name.
|
static Bson |
Updates.bitwiseAnd(String fieldName,
long value)
Creates an update that performs a bitwise and between the given long value and the integral value of the field with the given name.
|
static Bson |
Updates.bitwiseOr(String fieldName,
int value)
Creates an update that performs a bitwise or between the given integer value and the integral value of the field with the given
name.
|
static Bson |
Updates.bitwiseOr(String fieldName,
long value)
Creates an update that performs a bitwise or between the given long value and the integral value of the field with the given name.
|
static Bson |
Updates.bitwiseXor(String fieldName,
int value)
Creates an update that performs a bitwise xor between the given integer value and the integral value of the field with the given
name.
|
static Bson |
Updates.bitwiseXor(String fieldName,
long value)
Creates an update that performs a bitwise xor between the given long value and the integral value of the field with the given name.
|
static Bson |
Updates.combine(Bson... updates)
Combine a list of updates into a single update.
|
static Bson |
Updates.combine(List<Bson> updates)
Combine a list of updates into a single update.
|
static Bson |
Indexes.compoundIndex(Bson... indexes)
create a compound index specifications.
|
static Bson |
Indexes.compoundIndex(List<Bson> indexes)
compound multiple index specifications.
|
static <TExpression> |
Projections.computed(String fieldName,
TExpression expression)
Creates a projection of a field whose value is computed from the given expression.
|
static Bson |
Updates.currentDate(String fieldName)
Creates an update that sets the value of the field to the current date as a BSON date.
|
static Bson |
Updates.currentTimestamp(String fieldName)
Creates an update that sets the value of the field to the current date as a BSON timestamp.
|
static Bson |
Indexes.descending(List<String> fieldNames)
Create an index key for an ascending index on the given fields.
|
static Bson |
Sorts.descending(List<String> fieldNames)
Create a sort specification for an ascending sort on the given fields.
|
static Bson |
Indexes.descending(String... fieldNames)
Create an index key for an ascending index on the given fields.
|
static Bson |
Sorts.descending(String... fieldNames)
Create a sort specification for an ascending sort on the given fields.
|
static Bson |
Projections.elemMatch(String fieldName)
Creates a projection that includes for the given field only the first element of an array that matches the query filter.
|
static Bson |
Projections.elemMatch(String fieldName,
Bson filter)
Creates a projection that includes for the given field only the first element of the array value of that field that matches the given
query filter.
|
static Bson |
Filters.elemMatch(String fieldName,
Bson filter)
Creates a filter that matches all documents containing a field that is an array where at least one member of the array matches the
given filter.
|
static <TItem> Bson |
Filters.eq(String fieldName,
TItem value)
Creates a filter that matches all documents where the value of the field name equals the specified value.
|
static Bson |
Projections.exclude(List<String> fieldNames)
Creates a projection that excludes all of the given fields.
|
static Bson |
Projections.exclude(String... fieldNames)
Creates a projection that excludes all of the given fields.
|
static Bson |
Projections.excludeId()
Creates a projection that excludes the _id field.
|
static Bson |
Filters.exists(String fieldName)
Creates a filter that matches all documents that contain the given field.
|
static Bson |
Filters.exists(String fieldName,
boolean exists)
Creates a filter that matches all documents that either contain or do not contain the given field, depending on the value of the
exists parameter.
|
static Bson |
Projections.fields(Bson... projections)
Creates a projection that combines the list of projections into a single one.
|
static Bson |
Projections.fields(List<Bson> projections)
Creates a projection that combines the list of projections into a single one.
|
static Bson |
Indexes.geo2d(String fieldName)
Create an index key for a 2d index on the given field.
|
static Bson |
Indexes.geo2dsphere(List<String> fieldNames)
Create an index key for an ascending index on the given fields.
|
static Bson |
Indexes.geo2dsphere(String... fieldNames)
Create an index key for an 2dsphere index on the given fields.
|
static Bson |
Indexes.geoHaystack(String fieldName,
Bson additional)
Create an index key for a geohaystack index on the given field.
|
static Bson |
Filters.geoIntersects(String fieldName,
Bson geometry)
Creates a filter that matches all documents containing a field with geospatial data that intersects with the specified shape.
|
static Bson |
Filters.geoIntersects(String fieldName,
Geometry geometry)
Creates a filter that matches all documents containing a field with geospatial data that intersects with the specified shape.
|
static Bson |
Filters.geoWithin(String fieldName,
Bson geometry)
Creates a filter that matches all documents containing a field with geospatial data that exists entirely within the specified shape.
|
static Bson |
Filters.geoWithin(String fieldName,
Geometry geometry)
Creates a filter that matches all documents containing a field with geospatial data that exists entirely within the specified shape.
|
static Bson |
Filters.geoWithinBox(String fieldName,
double lowerLeftX,
double lowerLeftY,
double upperRightX,
double upperRightY)
Creates a filter that matches all documents containing a field with grid coordinates data that exist entirely within the specified
box.
|
static Bson |
Filters.geoWithinCenter(String fieldName,
double x,
double y,
double radius)
Creates a filter that matches all documents containing a field with grid coordinates data that exist entirely within the specified
circle.
|
static Bson |
Filters.geoWithinCenterSphere(String fieldName,
double x,
double y,
double radius)
Creates a filter that matches all documents containing a field with geospatial data (GeoJSON or legacy coordinate pairs) that exist
entirely within the specified circle, using spherical geometry.
|
static Bson |
Filters.geoWithinPolygon(String fieldName,
List<List<Double>> points)
Creates a filter that matches all documents containing a field with grid coordinates data that exist entirely within the specified
polygon.
|
Bson |
UpdateManyModel.getFilter()
Gets the query filter.
|
Bson |
DeleteOneModel.getFilter()
Gets the query filter.
|
Bson |
UpdateOneModel.getFilter()
Gets the query filter.
|
Bson |
DeleteManyModel.getFilter()
Gets the query filter.
|
Bson |
ReplaceOneModel.getFilter()
Gets the query filter.
|
Bson |
CountOptions.getHint()
Gets the hint to apply.
|
Bson |
IndexModel.getKeys()
Gets the index keys.
|
Bson |
FindOptions.getModifiers()
Gets the query modifiers to apply to this operation.
|
Bson |
IndexOptions.getPartialFilterExpression()
Get the filter expression for the documents to be included in the index or null if not set
|
Bson |
FindOneAndReplaceOptions.getProjection()
Gets a document describing the fields to return for all matching documents.
|
Bson |
FindOneAndDeleteOptions.getProjection()
Gets a document describing the fields to return for all matching documents.
|
Bson |
FindOptions.getProjection()
Gets a document describing the fields to return for all matching documents.
|
Bson |
FindOneAndUpdateOptions.getProjection()
Gets a document describing the fields to return for all matching documents.
|
Bson |
FindOneAndReplaceOptions.getSort()
Gets the sort criteria to apply to the query.
|
Bson |
FindOneAndDeleteOptions.getSort()
Gets the sort criteria to apply to the query.
|
Bson |
FindOptions.getSort()
Gets the sort criteria to apply to the query.
|
Bson |
FindOneAndUpdateOptions.getSort()
Gets the sort criteria to apply to the query.
|
Bson |
PushOptions.getSortDocument()
Gets the sort direction for sorting array elements that are documents.
|
Bson |
IndexOptionDefaults.getStorageEngine()
Gets the default storage engine options document for indexes.
|
Bson |
IndexOptions.getStorageEngine()
Gets the storage engine options document for this index.
|
Bson |
CreateCollectionOptions.getStorageEngineOptions()
Gets the storage engine options document for the collection.
|
Bson |
UpdateManyModel.getUpdate()
Gets the document specifying the updates to apply to the matching document.
|
Bson |
UpdateOneModel.getUpdate()
Gets the document specifying the updates to apply to the matching document.
|
Bson |
ValidationOptions.getValidator()
Gets the validation rules if set or null.
|
Bson |
BsonField.getValue()
Gets the field value
|
Bson |
IndexOptions.getWeights()
Gets the weighting object for use with a text index
|
static <TExpression> |
Aggregates.group(TExpression id,
BsonField... fieldAccumulators)
Creates a $group pipeline stage for the specified filter
|
static <TExpression> |
Aggregates.group(TExpression id,
List<BsonField> fieldAccumulators)
Creates a $group pipeline stage for the specified filter
|
static <TItem> Bson |
Filters.gt(String fieldName,
TItem value)
Creates a filter that matches all documents where the value of the given field is greater than the specified value.
|
static <TItem> Bson |
Filters.gte(String fieldName,
TItem value)
Creates a filter that matches all documents where the value of the given field is greater than or equal to the specified value.
|
static Bson |
Indexes.hashed(String fieldName)
Create an index key for a hashed index on the given field.
|
static <TItem> Bson |
Filters.in(String fieldName,
Iterable<TItem> values)
Creates a filter that matches all documents where the value of a field equals any value in the list of specified values.
|
static <TItem> Bson |
Filters.in(String fieldName,
TItem... values)
Creates a filter that matches all documents where the value of a field equals any value in the list of specified values.
|
static Bson |
Updates.inc(String fieldName,
Number number)
Creates an update that increments the value of the field with the given name by the given value.
|
static Bson |
Projections.include(List<String> fieldNames)
Creates a projection that includes all of the given fields.
|
static Bson |
Projections.include(String... fieldNames)
Creates a projection that includes all of the given fields.
|
static Bson |
Aggregates.limit(int limit)
Creates a $limit pipeline stage for the specified filter
|
static Bson |
Aggregates.lookup(String from,
String localField,
String foreignField,
String as)
Creates a $lookup pipeline stage for the specified filter
|
static <TItem> Bson |
Filters.lt(String fieldName,
TItem value)
Creates a filter that matches all documents where the value of the given field is less than the specified value.
|
static <TItem> Bson |
Filters.lte(String fieldName,
TItem value)
Creates a filter that matches all documents where the value of the given field is less than or equal to the specified value.
|
static Bson |
Aggregates.match(Bson filter)
Creates a $match pipeline stage for the specified filter
|
static <TItem> Bson |
Updates.max(String fieldName,
TItem value)
Creates an update that sets the value of the field to the given value if the given value is greater than the current value of the
field.
|
static Bson |
Sorts.metaTextScore(String fieldName)
Create a sort specification for the text score meta projection on the given field.
|
static Bson |
Projections.metaTextScore(String fieldName)
Creates a projection to the given field name of the textScore, for use with text queries.
|
static <TItem> Bson |
Updates.min(String fieldName,
TItem value)
Creates an update that sets the value of the field to the given value if the given value is less than the current value of the
field.
|
static Bson |
Filters.mod(String fieldName,
long divisor,
long remainder)
Creates a filter that matches all documents where the value of a field divided by a divisor has the specified remainder (i.e.
|
static Bson |
Updates.mul(String fieldName,
Number number)
Creates an update that multiplies the value of the field with the given name by the given number.
|
static <TItem> Bson |
Filters.ne(String fieldName,
TItem value)
Creates a filter that matches all documents where the value of the field name does not equal the specified value.
|
static Bson |
Filters.near(String fieldName,
Bson geometry,
Double maxDistance,
Double minDistance)
Creates a filter that matches all documents containing a field with geospatial data that is near the specified GeoJSON point.
|
static Bson |
Filters.near(String fieldName,
double x,
double y,
Double maxDistance,
Double minDistance)
Creates a filter that matches all documents containing a field with geospatial data that is near the specified point.
|
static Bson |
Filters.near(String fieldName,
Point geometry,
Double maxDistance,
Double minDistance)
Creates a filter that matches all documents containing a field with geospatial data that is near the specified GeoJSON point.
|
static Bson |
Filters.nearSphere(String fieldName,
Bson geometry,
Double maxDistance,
Double minDistance)
Creates a filter that matches all documents containing a field with geospatial data that is near the specified GeoJSON point using
spherical geometry.
|
static Bson |
Filters.nearSphere(String fieldName,
double x,
double y,
Double maxDistance,
Double minDistance)
Creates a filter that matches all documents containing a field with geospatial data that is near the specified point using
spherical geometry.
|
static Bson |
Filters.nearSphere(String fieldName,
Point geometry,
Double maxDistance,
Double minDistance)
Creates a filter that matches all documents containing a field with geospatial data that is near the specified GeoJSON point using
spherical geometry.
|
static <TItem> Bson |
Filters.nin(String fieldName,
Iterable<TItem> values)
Creates a filter that matches all documents where the value of a field does not equal any of the specified values or does not exist.
|
static <TItem> Bson |
Filters.nin(String fieldName,
TItem... values)
Creates a filter that matches all documents where the value of a field does not equal any of the specified values or does not exist.
|
static Bson |
Filters.nor(Bson... filters)
Creates a filter that performs a logical NOR operation on all the specified filters.
|
static Bson |
Filters.nor(Iterable<Bson> filters)
Creates a filter that performs a logical NOR operation on all the specified filters.
|
static Bson |
Filters.not(Bson filter)
Creates a filter that matches all documents that do not match the passed in filter.
|
static Bson |
Filters.or(Bson... filters)
Creates a filter that preforms a logical OR of the provided list of filters.
|
static Bson |
Filters.or(Iterable<Bson> filters)
Creates a filter that preforms a logical OR of the provided list of filters.
|
static Bson |
Sorts.orderBy(Bson... sorts)
Combine multiple sort specifications.
|
static Bson |
Sorts.orderBy(List<Bson> sorts)
Combine multiple sort specifications.
|
static Bson |
Aggregates.out(String collectionName)
Creates a $out pipeline stage for the specified filter
|
static Bson |
Updates.popFirst(String fieldName)
Creates an update that pops the first element of an array that is the value of the field with the given name.
|
static Bson |
Updates.popLast(String fieldName)
Creates an update that pops the last element of an array that is the value of the field with the given name.
|
static Bson |
Aggregates.project(Bson projection)
Creates a $project pipeline stage for the specified projection
|
static <TItem> Bson |
Updates.pull(String fieldName,
TItem value)
Creates an update that removes all instances of the given value from the array value of the field with the given name.
|
static <TItem> Bson |
Updates.pullAll(String fieldName,
List<TItem> values)
Creates an update that removes all instances of the given values from the array value of the field with the given name.
|
static Bson |
Updates.pullByFilter(Bson filter)
Creates an update that removes from an array all elements that match the given filter.
|
static <TItem> Bson |
Updates.push(String fieldName,
TItem value)
Creates an update that adds the given value to the array value of the field with the given name.
|
static <TItem> Bson |
Updates.pushEach(String fieldName,
List<TItem> values)
Creates an update that adds each of the given values to the array value of the field with the given name.
|
static <TItem> Bson |
Updates.pushEach(String fieldName,
List<TItem> values,
PushOptions options)
Creates an update that adds each of the given values to the array value of the field with the given name, applying the given
options for positioning the pushed values, and then slicing and/or sorting the array.
|
static Bson |
Filters.regex(String fieldName,
Pattern pattern)
Creates a filter that matches all documents where the value of the field matches the given regular expression pattern with the given
options applied.
|
static Bson |
Filters.regex(String fieldName,
String pattern)
Creates a filter that matches all documents where the value of the field matches the given regular expression pattern with the given
options applied.
|
static Bson |
Filters.regex(String fieldName,
String pattern,
String options)
Creates a filter that matches all documents where the value of the field matches the given regular expression pattern with the given
options applied.
|
static Bson |
Updates.rename(String fieldName,
String newFieldName)
Creates an update that renames a field.
|
static Bson |
Aggregates.sample(int size)
Creates a $sample pipeline stage with the specified sample size
|
static <TItem> Bson |
Updates.set(String fieldName,
TItem value)
Creates an update that sets the value of the field with the given name to the given value.
|
static <TItem> Bson |
Updates.setOnInsert(String fieldName,
TItem value)
Creates an update that sets the value of the field with the given name to the given value, but only if the update is an upsert that
results in an insert of a document.
|
static Bson |
Filters.size(String fieldName,
int size)
Creates a filter that matches all documents where the value of a field is an array of the specified size.
|
static Bson |
Aggregates.skip(int skip)
Creates a $skip pipeline stage
|
static Bson |
Projections.slice(String fieldName,
int limit)
Creates a projection to the given field name of a slice of the array value of that field.
|
static Bson |
Projections.slice(String fieldName,
int skip,
int limit)
Creates a projection to the given field name of a slice of the array value of that field.
|
static Bson |
Aggregates.sort(Bson sort)
Creates a $sort pipeline stage for the specified sort specification
|
static Bson |
Indexes.text(String fieldName)
Create an index key for a text index on the given field.
|
static Bson |
Filters.text(String search)
Creates a filter that matches all documents matching the given search term.
|
static Bson |
Filters.text(String search,
String language)
Deprecated.
|
static Bson |
Filters.text(String search,
TextSearchOptions textSearchOptions)
Creates a filter that matches all documents matching the given the search term with the given text search options.
|
static Bson |
Filters.type(String fieldName,
BsonType type)
Creates a filter that matches all documents where the value of the field is of the specified BSON type.
|
static Bson |
Filters.type(String fieldName,
String type)
Creates a filter that matches all documents where the value of the field is of the specified BSON type.
|
static Bson |
Updates.unset(String fieldName)
Creates an update that deletes the field with the given name.
|
static Bson |
Aggregates.unwind(String fieldName)
Creates a $unwind pipeline stage for the specified field name, which must be prefixed by a
'$' sign. |
static Bson |
Aggregates.unwind(String fieldName,
UnwindOptions unwindOptions)
Creates a $unwind pipeline stage for the specified field name, which must be prefixed by a
'$' sign. |
static Bson |
Filters.where(String javaScriptExpression)
Creates a filter that matches all documents for which the given expression is true.
|
Modifier and Type | Method and Description |
---|---|
static Bson |
Filters.and(Bson... filters)
Creates a filter that performs a logical AND of the provided list of filters.
|
static Bson |
Updates.combine(Bson... updates)
Combine a list of updates into a single update.
|
static Bson |
Indexes.compoundIndex(Bson... indexes)
create a compound index specifications.
|
static Bson |
Projections.elemMatch(String fieldName,
Bson filter)
Creates a projection that includes for the given field only the first element of the array value of that field that matches the given
query filter.
|
static Bson |
Filters.elemMatch(String fieldName,
Bson filter)
Creates a filter that matches all documents containing a field that is an array where at least one member of the array matches the
given filter.
|
static Bson |
Projections.fields(Bson... projections)
Creates a projection that combines the list of projections into a single one.
|
static Bson |
Indexes.geoHaystack(String fieldName,
Bson additional)
Create an index key for a geohaystack index on the given field.
|
static Bson |
Filters.geoIntersects(String fieldName,
Bson geometry)
Creates a filter that matches all documents containing a field with geospatial data that intersects with the specified shape.
|
static Bson |
Filters.geoWithin(String fieldName,
Bson geometry)
Creates a filter that matches all documents containing a field with geospatial data that exists entirely within the specified shape.
|
CountOptions |
CountOptions.hint(Bson hint)
Sets the hint to apply.
|
static Bson |
Aggregates.match(Bson filter)
Creates a $match pipeline stage for the specified filter
|
FindOptions |
FindOptions.modifiers(Bson modifiers)
Sets the query modifiers to apply to this operation.
|
static Bson |
Filters.near(String fieldName,
Bson geometry,
Double maxDistance,
Double minDistance)
Creates a filter that matches all documents containing a field with geospatial data that is near the specified GeoJSON point.
|
static Bson |
Filters.nearSphere(String fieldName,
Bson geometry,
Double maxDistance,
Double minDistance)
Creates a filter that matches all documents containing a field with geospatial data that is near the specified GeoJSON point using
spherical geometry.
|
static Bson |
Filters.nor(Bson... filters)
Creates a filter that performs a logical NOR operation on all the specified filters.
|
static Bson |
Filters.not(Bson filter)
Creates a filter that matches all documents that do not match the passed in filter.
|
static Bson |
Filters.or(Bson... filters)
Creates a filter that preforms a logical OR of the provided list of filters.
|
static Bson |
Sorts.orderBy(Bson... sorts)
Combine multiple sort specifications.
|
IndexOptions |
IndexOptions.partialFilterExpression(Bson partialFilterExpression)
Sets the filter expression for the documents to be included in the index
|
static Bson |
Aggregates.project(Bson projection)
Creates a $project pipeline stage for the specified projection
|
FindOneAndReplaceOptions |
FindOneAndReplaceOptions.projection(Bson projection)
Sets a document describing the fields to return for all matching documents.
|
FindOneAndDeleteOptions |
FindOneAndDeleteOptions.projection(Bson projection)
Sets a document describing the fields to return for all matching documents.
|
FindOptions |
FindOptions.projection(Bson projection)
Sets a document describing the fields to return for all matching documents.
|
FindOneAndUpdateOptions |
FindOneAndUpdateOptions.projection(Bson projection)
Sets a document describing the fields to return for all matching documents.
|
static Bson |
Updates.pullByFilter(Bson filter)
Creates an update that removes from an array all elements that match the given filter.
|
FindOneAndReplaceOptions |
FindOneAndReplaceOptions.sort(Bson sort)
Sets the sort criteria to apply to the query.
|
static Bson |
Aggregates.sort(Bson sort)
Creates a $sort pipeline stage for the specified sort specification
|
FindOneAndDeleteOptions |
FindOneAndDeleteOptions.sort(Bson sort)
Sets the sort criteria to apply to the query.
|
FindOptions |
FindOptions.sort(Bson sort)
Sets the sort criteria to apply to the query.
|
FindOneAndUpdateOptions |
FindOneAndUpdateOptions.sort(Bson sort)
Sets the sort criteria to apply to the query.
|
PushOptions |
PushOptions.sortDocument(Bson sortDocument)
Sets the sort direction for sorting array elements that are documents.
|
IndexOptionDefaults |
IndexOptionDefaults.storageEngine(Bson storageEngine)
Sets the default storage engine options document for indexes.
|
IndexOptions |
IndexOptions.storageEngine(Bson storageEngine)
Sets the storage engine options document for this index.
|
CreateCollectionOptions |
CreateCollectionOptions.storageEngineOptions(Bson storageEngineOptions)
Sets the storage engine options document defaults for the collection
|
ValidationOptions |
ValidationOptions.validator(Bson validator)
Sets the validation rules for all
|
IndexOptions |
IndexOptions.weights(Bson weights)
Sets the weighting object for use with a text index.
|
Modifier and Type | Method and Description |
---|---|
static Bson |
Filters.and(Iterable<Bson> filters)
Creates a filter that performs a logical AND of the provided list of filters.
|
static Bson |
Updates.combine(List<Bson> updates)
Combine a list of updates into a single update.
|
static Bson |
Indexes.compoundIndex(List<Bson> indexes)
compound multiple index specifications.
|
static Bson |
Projections.fields(List<Bson> projections)
Creates a projection that combines the list of projections into a single one.
|
static Bson |
Filters.nor(Iterable<Bson> filters)
Creates a filter that performs a logical NOR operation on all the specified filters.
|
static Bson |
Filters.or(Iterable<Bson> filters)
Creates a filter that preforms a logical OR of the provided list of filters.
|
static Bson |
Sorts.orderBy(List<Bson> sorts)
Combine multiple sort specifications.
|
Constructor and Description |
---|
BsonField(String name,
Bson value)
Construct an instance
|
DeleteManyModel(Bson filter)
Construct a new instance.
|
DeleteOneModel(Bson filter)
Construct a new instance.
|
IndexModel(Bson keys)
Construct an instance with the given keys.
|
IndexModel(Bson keys,
IndexOptions options)
Construct an instance with the given keys and options.
|
ReplaceOneModel(Bson filter,
T replacement)
Construct a new instance.
|
ReplaceOneModel(Bson filter,
T replacement,
UpdateOptions options)
Construct a new instance.
|
UpdateManyModel(Bson filter,
Bson update)
Construct a new instance.
|
UpdateManyModel(Bson filter,
Bson update,
UpdateOptions options)
Construct a new instance.
|
UpdateOneModel(Bson filter,
Bson update)
Construct a new instance.
|
UpdateOneModel(Bson filter,
Bson update,
UpdateOptions options)
Construct a new instance.
|
Modifier and Type | Class and Description |
---|---|
class |
BsonDocument
A type-safe container for a BSON document.
|
class |
BsonDocumentWrapper<T>
A
BsonDocument that begins its life as a document of any type and an Encoder for that document, which lets an instance of
any class with an Encoder be treated as a BsonDocument. |
class |
Document
A representation of a document as a
Map . |
class |
RawBsonDocument
An immutable BSON document that is represented using only the raw bytes.
|
Copyright © 2016. All Rights Reserved.