package model
The model package containing models and options that help describe MongoCollection
operations
- Alphabetic
- By Inheritance
- model
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
type
BsonField = com.mongodb.client.model.BsonField
A representation of a BSON document field whose value is another BSON document.
-
type
BucketAutoOptions = com.mongodb.client.model.BucketAutoOptions
The options for a $bucketAuto aggregation pipeline stage
The options for a $bucketAuto aggregation pipeline stage
- Since
1.2
-
type
BucketGranularity = com.mongodb.client.model.BucketGranularity
Granularity values for automatic bucketing.
Granularity values for automatic bucketing.
- Since
1.2
- See also
-
type
BucketOptions = com.mongodb.client.model.BucketOptions
The options for a $bucket aggregation pipeline stage
The options for a $bucket aggregation pipeline stage
- Since
1.2
-
type
BulkWriteOptions = com.mongodb.client.model.BulkWriteOptions
The options to apply to a bulk write.
-
type
Collation = com.mongodb.client.model.Collation
The collation options.
-
type
CollationAlternate = com.mongodb.client.model.CollationAlternate
The collation alternative options.
-
type
CollationCaseFirst = com.mongodb.client.model.CollationCaseFirst
The collation configuration of how character cases are handled
-
type
CollationMaxVariable = com.mongodb.client.model.CollationMaxVariable
The collation max variable options
-
type
CollationStrength = com.mongodb.client.model.CollationStrength
The collation configuration of how differences between characters are handled.
-
type
CountOptions = com.mongodb.client.model.CountOptions
The options to apply to a count operation.
-
type
CreateCollectionOptions = com.mongodb.client.model.CreateCollectionOptions
Options for creating a collection
-
type
CreateIndexOptions = com.mongodb.client.model.CreateIndexOptions
The options to apply to the command when creating indexes.
The options to apply to the command when creating indexes.
- Since
2.2
-
type
CreateViewOptions = com.mongodb.client.model.CreateViewOptions
Options for creating a view
Options for creating a view
- Since
1.2
- Note
Requires MongoDB 3.4 or greater
-
type
DeleteManyModel[TResult] = com.mongodb.client.model.DeleteManyModel[TResult]
A model describing the removal of all documents matching the query filter.
-
type
DeleteOneModel[TResult] = com.mongodb.client.model.DeleteOneModel[TResult]
A model describing the removal of at most one document matching the query filter.
-
type
DeleteOptions = com.mongodb.client.model.DeleteOptions
The options to apply for delete operations
-
type
DropIndexOptions = com.mongodb.client.model.DropIndexOptions
The options to apply to the command when creating indexes.
The options to apply to the command when creating indexes.
- Since
2.2
-
type
Facet = com.mongodb.client.model.Facet
Defines a Facet for use in $facet pipeline stages.
Defines a Facet for use in $facet pipeline stages.
- Since
1.2
-
type
Field[TExpression] = com.mongodb.client.model.Field[TExpression]
A helper to define new fields for the $addFields pipeline stage
A helper to define new fields for the $addFields pipeline stage
- Since
1.2
-
type
FindOneAndDeleteOptions = com.mongodb.client.model.FindOneAndDeleteOptions
The options to apply to an operation that atomically finds a document and deletes it.
-
type
FindOneAndReplaceOptions = com.mongodb.client.model.FindOneAndReplaceOptions
The options to apply to an operation that atomically finds a document and replaces it.
-
type
FindOneAndUpdateOptions = com.mongodb.client.model.FindOneAndUpdateOptions
The options to apply to an operation that atomically finds a document and updates it.
-
type
FindOptions = com.mongodb.client.model.FindOptions
The options to apply to a find operation.
-
type
GraphLookupOptions = com.mongodb.client.model.GraphLookupOptions
The options for a graphLookup aggregation pipeline stage
The options for a graphLookup aggregation pipeline stage
- Since
1.2
-
type
IndexModel = com.mongodb.client.model.IndexModel
A model describing the creation of a single index.
-
type
IndexOptionDefaults = com.mongodb.client.model.IndexOptionDefaults
The default options for a collection to apply on the creation of indexes.
The default options for a collection to apply on the creation of indexes.
- Since
1.1
- Note
Requires MongoDB 3.2 or greater
- See also
-
type
IndexOptions = com.mongodb.client.model.IndexOptions
The options to apply to the creation of an index.
-
type
InsertManyOptions = com.mongodb.client.model.InsertManyOptions
The options to apply to an operation that inserts multiple documents into a collection.
-
type
InsertOneModel[TResult] = com.mongodb.client.model.InsertOneModel[TResult]
A model describing an insert of a single document.
-
type
InsertOneOptions = com.mongodb.client.model.InsertOneOptions
The options to apply to an operation that inserts a single document into a collection.
The options to apply to an operation that inserts a single document into a collection.
- Since
1.1
- Note
Requires MongoDB 3.2 or greater
-
type
MapReduceAction = com.mongodb.client.model.MapReduceAction
The map reduce to collection actions.
The map reduce to collection actions.
These actions are only available when passing out a collection that already exists. This option is not available on secondary members of replica sets. The Enum values dictate what to do with the output collection if it already exists when the map reduce is run.
-
type
PushOptions = com.mongodb.client.model.PushOptions
The options to apply to a
$push
update operator. -
type
RenameCollectionOptions = com.mongodb.client.model.RenameCollectionOptions
The options to apply when renaming a collection
-
type
ReplaceOneModel[TResult] = com.mongodb.client.model.ReplaceOneModel[TResult]
A model describing the replacement of at most one document that matches the query filter.
-
type
ReturnDocument = com.mongodb.client.model.ReturnDocument
Indicates which document to return, the original document before change or the document after the change
-
type
TextSearchOptions = com.mongodb.client.model.TextSearchOptions
Text search options for the Filters text helper
-
type
UnwindOptions = com.mongodb.client.model.UnwindOptions
The options for an unwind aggregation pipeline stage
The options for an unwind aggregation pipeline stage
- Since
1.1
- Note
Requires MongoDB 3.2 or greater
-
type
UpdateManyModel[TResult] = com.mongodb.client.model.UpdateManyModel[TResult]
A model describing an update to all documents that matches the query filter.
A model describing an update to all documents that matches the query filter. The update to apply must include only update operators.
-
type
UpdateOneModel[TResult] = com.mongodb.client.model.UpdateOneModel[TResult]
A model describing an update to at most one document that matches the query filter.
A model describing an update to at most one document that matches the query filter. The update to apply must include only update operators.
-
type
UpdateOptions = com.mongodb.client.model.UpdateOptions
The options to apply when updating documents.
-
type
ValidationAction = com.mongodb.client.model.ValidationAction
Determines whether to error on invalid documents or just warn about the violations but allow invalid documents.
Determines whether to error on invalid documents or just warn about the violations but allow invalid documents.
- Since
1.1
- Note
Requires MongoDB 3.2 or greater
-
type
ValidationLevel = com.mongodb.client.model.ValidationLevel
Determines how strictly MongoDB applies the validation rules to existing documents during an insert or update.
Determines how strictly MongoDB applies the validation rules to existing documents during an insert or update.
- Since
1.1
- Note
Requires MongoDB 3.2 or greater
-
type
ValidationOptions = com.mongodb.client.model.ValidationOptions
Validation options for documents being inserted or updated in a collection
Validation options for documents being inserted or updated in a collection
- Since
1.1
- Note
Requires MongoDB 3.2 or greater
-
type
WriteModel[TResult] = com.mongodb.client.model.WriteModel[TResult]
A base class for models that can be used in a bulk write operations.
Value Members
-
object
Accumulators
Builders for accumulators used in the group pipeline stage of an aggregation pipeline.
Builders for accumulators used in the group pipeline stage of an aggregation pipeline.
- Since
1.0
- See also
-
object
Aggregates
Builders for aggregation pipeline stages.
Builders for aggregation pipeline stages.
- Since
1.0
- See also
-
object
BsonField
A representation of a BSON document field whose value is another BSON document.
-
object
BucketAutoOptions
The options for a $bucketAuto aggregation pipeline stage
The options for a $bucketAuto aggregation pipeline stage
- Since
1.2
-
object
BucketGranularity
Granularity values for automatic bucketing.
Granularity values for automatic bucketing.
- Since
1.2
- See also
-
object
BucketOptions
The options for a $bucket aggregation pipeline stage
The options for a $bucket aggregation pipeline stage
- Since
1.2
-
object
BulkWriteOptions
The options to apply to a bulk write.
-
object
Collation
The options regarding collation support in MongoDB 3.4+
The options regarding collation support in MongoDB 3.4+
- Since
1.2
- Note
Requires MongoDB 3.4 or greater
-
object
CollationAlternate
Collation support allows the specific configuration of whether or not spaces and punctuation are considered base characters.
Collation support allows the specific configuration of whether or not spaces and punctuation are considered base characters.
- Since
1.2
- Note
Requires MongoDB 3.4 or greater
-
object
CollationCaseFirst
Collation support allows the specific configuration of how character cases are handled.
Collation support allows the specific configuration of how character cases are handled.
- Since
1.2
- Note
Requires MongoDB 3.4 or greater
-
object
CollationMaxVariable
Collation support allows the specific configuration of whether or not spaces and punctuation are considered base characters.
Collation support allows the specific configuration of whether or not spaces and punctuation are considered base characters.
CollationMaxVariable
controls which characters are affected by CollationAlternate$.SHIFTED.- Since
1.2
- Note
Requires MongoDB 3.4 or greater
-
object
CollationStrength
Collation support allows the specific configuration of how character cases are handled.
Collation support allows the specific configuration of how character cases are handled.
- Since
1.2
- Note
Requires MongoDB 3.4 or greater
-
object
CountOptions
The options to apply to a count operation.
-
object
CreateCollectionOptions
Options for creating a collection
-
object
CreateViewOptions
Options for creating a view
Options for creating a view
- Since
1.2
- Note
Requires MongoDB 3.4 or greater
-
object
DeleteManyModel
A model describing the removal of all documents matching the query filter.
-
object
DeleteOneModel
A model describing the removal of at most one document matching the query filter.
-
object
DeleteOptions
The options to apply for delete operations.
-
object
Facet
Defines a Facet for use in $facet pipeline stages.
Defines a Facet for use in $facet pipeline stages.
- Since
1.2
-
object
Field
A helper to define new fields for the $addFields pipeline stage
A helper to define new fields for the $addFields pipeline stage
- Since
1.2
-
object
Filters
A factory for query filters.
A factory for query filters. A convenient way to use this class is to statically import all of its methods, which allows usage like:
collection.find(and(eq("x", 1), lt("y", 3)))
- Since
1.0
-
object
FindOneAndDeleteOptions
The options to apply to an operation that atomically finds a document and deletes it.
-
object
FindOneAndReplaceOptions
The options to apply to an operation that atomically finds a document and replaces it.
-
object
FindOneAndUpdateOptions
The options to apply to an operation that atomically finds a document and updates it.
-
object
FindOptions
The options to apply to a find operation.
-
object
GraphLookupOptions
The options for a graphLookup aggregation pipeline stage
The options for a graphLookup aggregation pipeline stage
- Since
1.2
-
object
IndexModel
A model describing the creation of a single index.
-
object
IndexOptionDefaults
Options for creating an index
-
object
IndexOptions
The options to apply to the creation of an index.
-
object
Indexes
A factory for defining index keys.
A factory for defining index keys. A convenient way to use this class is to statically import all of its methods, which allows usage like:
collection.createIndex(compoundIndex(ascending("x"), descending("y")))
- Since
1.0
-
object
InsertManyOptions
The options to apply to an operation that inserts multiple documents into a collection.
-
object
InsertOneModel
A model describing an insert of a single document.
-
object
InsertOneOptions
The options to apply to an operation that inserts a single document into a collection.
The options to apply to an operation that inserts a single document into a collection.
- Since
1.1
- Note
Requires MongoDB 3.2 or greater
-
object
MapReduceAction
The map reduce to collection actions.
The map reduce to collection actions.
These actions are only available when passing out a collection that already exists. This option is not available on secondary members of replica sets. The Enum values dictate what to do with the output collection if it already exists when the map reduce is run.
- Since
1.0
-
object
Projections
A factory for projections.
A factory for projections. A convenient way to use this class is to statically import all of its methods, which allows usage like:
collection.find().projection(fields(include("x", "y"), excludeId()))
- Since
1.0
-
object
PushOptions
The options to apply to a
$push
update operator. -
object
RenameCollectionOptions
The options to apply when renaming a collection
-
object
ReplaceOneModel
A model describing the replacement of at most one document that matches the query filter.
-
object
ReturnDocument
Indicates which document to return, the original document before change or the document after the change
Indicates which document to return, the original document before change or the document after the change
- Since
1.0
-
object
Sorts
A factory for sort specifications.
A factory for sort specifications. A convenient way to use this class is to statically import all of its methods, which allows usage like:
collection.find().sort(orderBy(ascending("x", "y"), descending("z")))
- Since
1.0
-
object
TextSearchOptions
Text search options for the Filters text helper
Text search options for the Filters text helper
- Since
1.1
-
object
UnwindOptions
The options for an unwind aggregation pipeline stage
The options for an unwind aggregation pipeline stage
- Since
1.1
- Note
Requires MongoDB 3.2 or greater
-
object
UpdateManyModel
A model describing an update to all documents that matches the query filter.
A model describing an update to all documents that matches the query filter. The update to apply must include only update operators.
-
object
UpdateOneModel
A model describing an update to at most one document that matches the query filter.
A model describing an update to at most one document that matches the query filter. The update to apply must include only update operators.
-
object
UpdateOptions
The options to apply when updating documents.
-
object
Updates
A factory for document updates.
A factory for document updates. A convenient way to use this class is to statically import all of its methods, which allows usage like:
collection.updateOne(eq("x", 1), set("x", 2))
- Since
1.0
-
object
ValidationAction
Determines how strictly MongoDB applies the validation rules to existing documents during an insert or update.
Determines how strictly MongoDB applies the validation rules to existing documents during an insert or update.
- Since
1.1
- Note
Requires MongoDB 3.2 or greater
-
object
ValidationLevel
Determines how strictly MongoDB applies the validation rules to existing documents during an insert or update.
Determines how strictly MongoDB applies the validation rules to existing documents during an insert or update.
- Since
1.1
- Note
Requires MongoDB 3.2 or greater
-
object
ValidationOptions
Validation options for documents being inserted or updated in a collection
Validation options for documents being inserted or updated in a collection
- Since
1.1
- Note
Requires MongoDB 3.2 or greater
This is the documentation for the MongoDB Scala driver.
Driver structure
The mongodb scala driver.
To get started you need a MongoClient instance, either from a connection string or via a org.mongodb.scala.MongoClientSettings.
Notable packages include: