Observable for aggregate
Observable for aggregate
The type of the result.
the underlying java AggregateObservable
1.0
The client-side automatic encryption settings.
The client-side automatic encryption settings. Client side encryption enables an application to specify what fields in a collection must be encrypted, and the driver automatically encrypts commands sent to MongoDB and decrypts responses.
Automatic encryption is an enterprise only feature that only applies to operations on a collection. Automatic encryption is not
supported for operations on a database or view and will result in error. To bypass automatic encryption,
set bypassAutoEncryption=true in AutoEncryptionSettings
.
Explicit encryption/decryption and automatic decryption is a community feature, enabled with the new
com.mongodb.client.vault.ClientEncryption
type.
A MongoClient configured with bypassAutoEncryption=true will still automatically decrypt.
If automatic encryption fails on an operation, use a MongoClient configured with bypassAutoEncryption=true and use ClientEncryption#encrypt to manually encrypt values.
Enabling client side encryption reduces the maximum document and message size (using a maxBsonObjectSize of 2MiB and maxMessageSizeBytes of 6MB) and may have a negative performance impact.
Automatic encryption requires the authenticated user to have the listCollections privilege action.
2.7
The result of a successful bulk write operation.
Observable for change streams.
Observable for change streams.
Note: The ChangeStreamDocument
class will not be applicable for all change stream outputs.
If using custom pipelines that radically change the result, the the ChangeStreamObservable#withDocumentClass method should be used
to provide an alternative document format.
The type of the result.
the underlying java ChangeStreamIterable
2.2
Requires MongoDB 3.6 or greater
The client-side settings for data key creation and explicit encryption.
The client-side settings for data key creation and explicit encryption.
Explicit encryption/decryption is a community feature, enabled with the new com.mongodb.client.vault.ClientEncryption
type,
for which this is the settings.
2.7
A Client Session
A Client Session
2.4
Extends the Java ClientSession and adds helpers for committing and aborting transactions.
Extends the Java ClientSession and adds helpers for committing and aborting transactions.
Automatically imported into the org.mongodb.scala
namespace
Options for creating ClientSessions
Options for creating ClientSessions
2.2
The Connection String
Observable for distinct
Observable for distinct
The type of the result.
the underlying java DistinctObservable
1.0
An immutable Document implementation.
An immutable Document implementation.
A strictly typed Map[String, BsonValue]
like structure that traverses the elements in insertion order. Unlike native scala maps there
is no variance in the value type and it always has to be a BsonValue
.
Subclass of WriteConcernException representing a duplicate key exception
Observable interface for Find.
Observable interface for Find.
The type of the result.
the underlying java FindObservable
1.0
Observable interface for ListCollections
Observable interface for ListCollections
The type of the result.
the underlying java ListCollectionsObservable
1.0
Observable interface for ListDatabases.
Observable interface for ListDatabases.
The type of the result.
the underlying java ListDatabasesObservable
1.0
Observable interface for ListIndexes.
Observable interface for ListIndexes.
The type of the result.
the underlying java ListIndexesObservable
1.0
Observable for map reduce.
An exception that represents all errors associated with a bulk write operation.
An exception indicating that a failure occurred when running a $changeStream
.
An exception indicating that a failure occurred when running a $changeStream
.
2.2
A client-side representation of a MongoDB cluster.
A client-side representation of a MongoDB cluster. Instances can represent either a standalone MongoDB instance, a replica set, or a sharded cluster. Instance of this class are responsible for maintaining an up-to-date state of the cluster, and possibly cache resources related to this, including background threads for monitoring, and connection pools.
Instance of this class server as factories for MongoDatabase instances.
the underlying java MongoClient
1.0
A base class for exceptions indicating a failure condition with the MongoClient.
Various settings to control the behavior of a MongoClient
.
The MongoCollection representation.
The MongoCollection representation.
The type that this collection will encode documents from and decode documents to.
the underlying java MongoCollection
1.0
An exception indicating that a command sent to a MongoDB server returned a failure.
Options for creating MongoCompressor
Options for creating MongoCompressor
2.2
Represents credentials to authenticate to a MongoDB server,as well as the source of the credentials and the authentication mechanism to use.
Subclass of MongoException representsing a cursor-not-found exception.
The MongoDatabase representation.
The MongoDatabase representation.
the underlying java MongoDatabase
1.0
The MongoDriverInformation class allows driver and library authors to add extra information about their library.
The MongoDriverInformation class allows driver and library authors to add extra information about their library. This information is then available in the MongoD/MongoS logs.
The following metadata can be included when creating a MongoClient
.
mongo-scala-driver
1.2.0
Scala 2.11
Note: Library authors are responsible for accepting MongoDriverInformation
from external libraries using their library.
Also all the meta data is limited to 512 bytes and any excess data will be truncated.
1.2
Requires MongoDB 3.4 or greater
Top level Exception for all Exceptions, server-side or client-side, that come from the driver.
Exception indicating that the execution of the current operation timed out as a result of the maximum operation time being exceeded.
An exception indicating that this version of the driver is not compatible with at least one of the servers that it is currently connected to.
A Mongo exception internal to the driver, not carrying any error code.
A non-checked exception indicating that the driver has been interrupted by a call to Thread.interrupt
.
A MongoDB namespace, which includes a database name and collection name.
An exception indicating that the server is a member of a replica set but is in recovery mode, and therefore refused to execute the operation.
An exception indicating that the server is a member of a replica set but is in recovery mode, and therefore refused to execute the operation. This can happen when a server is starting up and trying to join the replica set.
An exception indicating that the server is a member of a replica set but is not the primary, and therefore refused to execute either a write operation or a read operation that required a primary.
An exception indicating that the server is a member of a replica set but is not the primary, and therefore refused to execute either a write operation or a read operation that required a primary. This can happen during a replica set election.
An exception indicating that a query operation failed on the server.
This exception is thrown when there is an error reported by the underlying client authentication mechanism.
An exception indicating that some error has been raised by a MongoDB server in response to an operation.
This exception is thrown when trying to read or write from a closed socket.
Subclass of MongoException representing a network-related exception
This exception is thrown when there is an exception opening a Socket.
This exception is thrown when there is an exception reading a response from a Socket.
This exception is thrown when there is a timeout reading a response from the socket.
This exception is thrown when there is an exception writing a response to a Socket.
An exception indicating that the driver has timed out waiting for either a server or a connection to become available.
An exception indicating a failure to apply the write concern to the requested write operation
An exception indicating a failure to apply the write concern to the requested write operation
An exception indicating the failure of a write operation.
A Observable
represents a MongoDB operation and implements the Publisher
interface.
A Observable
represents a MongoDB operation and implements the Publisher
interface.
As such it is a provider of a potentially unbounded number of sequenced elements, publishing them according to the demand received from its Observer(s).
Extends the Publisher
interface and adds helpers to make Observables composable and simple to Subscribe to.
Implicit conversion support for Publishers, Observables and Subscriptions
Implicit conversion support for Publishers, Observables and Subscriptions
Automatically imported into the org.mongodb.scala
namespace
A Scala based wrapper of the Subscriber
interface which provides a mechanism for receiving push-based notifications.
A Scala based wrapper of the Subscriber
interface which provides a mechanism for receiving push-based notifications.
Will receive a call to Observer.onSubscribe(subscription: Subscription)
on subscription to the Observable.
Default implementations of this trait are greedy and will call Subscription.request with Long.MaxValue
so that all results are
requested. Custom implementations of the onSubscribe
method can be used to control "back-pressure" and ensure that only demand that
the Observer
is capable of handling is requested.
After signaling demand:
- One or more invocations of Observer.onNext up to the maximum number defined by Subscription.request - Single invocation of Observer.onError or Observer.onComplete which signals a terminal state after which no further events will be sent.
The type of element signaled.
Controls the level of isolation for reads.
Controls the level of isolation for reads.
1.1
The readConcern option allows clients to choose a level of isolation for their reads.
The readConcern option allows clients to choose a level of isolation for their reads.
1.1
Represents preferred replica set members to which a query or command can be sent.
The implicit ClientSession with Scala helpers
The implicit ClientSession with Scala helpers
Represents the location of a MongoDB server
A SingleObservable
represents an Observable that contains only a single item.
A SingleObservable
represents an Observable that contains only a single item.
the type of element signaled.
2.0
A Subscription
represents a one-to-one lifecycle of a Observer subscribing to an Observable.
A Subscription
represents a one-to-one lifecycle of a Observer subscribing to an Observable.
Instances can only be used once by a single Observer.
It is used to both signal desire for data and to allow for unsubscribing.
A replica set tag
An immutable set of tags, used to select members of a replica set to use for read operations.
Represents ReadPreferences that can be combined with tags
Options for transactions
Options for transactions
2.4
Controls the acknowledgment of write operations with various options.
An exception representing an error reported due to a write failure.
The result of a successful write operation.
The result of a successful write operation. If the write was unacknowledged, then wasAcknowledged
will return false and all
other methods with throw MongoUnacknowledgedWriteException
.
Represents the details of a write error , e.g.
Represents the details of a write error , e.g. a duplicate key error
The client-side automatic encryption settings.
The client-side automatic encryption settings. Client side encryption enables an application to specify what fields in a collection must be encrypted, and the driver automatically encrypts commands sent to MongoDB and decrypts responses.
Automatic encryption is an enterprise only feature that only applies to operations on a collection. Automatic encryption is not
supported for operations on a database or view and will result in error. To bypass automatic encryption,
set bypassAutoEncryption=true in AutoEncryptionSettings
.
Explicit encryption/decryption and automatic decryption is a community feature, enabled with the new
com.mongodb.client.vault.ClientEncryption
type.
A MongoClient configured with bypassAutoEncryption=true will still automatically decrypt.
If automatic encryption fails on an operation, use a MongoClient configured with bypassAutoEncryption=true and use ClientEncryption#encrypt to manually encrypt values.
Enabling client side encryption reduces the maximum document and message size (using a maxBsonObjectSize of 2MiB and maxMessageSizeBytes of 6MB) and may have a negative performance impact.
Automatic encryption requires the authenticated user to have the listCollections privilege action.
2.7
The client-side settings for data key creation and explicit encryption.
The client-side settings for data key creation and explicit encryption.
Explicit encryption/decryption is a community feature, enabled with the new com.mongodb.client.vault.ClientEncryption
type,
for which this is the settings.
2.7
The options to apply to a ClientSession
.
The options to apply to a ClientSession
.
2.2
ClientSession
Connection String companion object
An immutable Document implementation.
An immutable Document implementation.
A strictly typed Map[String, BsonValue]
like structure that traverses the elements in insertion order. Unlike native scala maps there
is no variance in the value type and it always has to be a BsonValue
.
Companion object for creating new MongoClient instances
Companion object for creating new MongoClient instances
1.0
A MongoClientSettings companion object
A MongoClientSettings companion object
1.0
Metadata describing a compressor to use for sending and receiving messages to a MongoDB server.
Metadata describing a compressor to use for sending and receiving messages to a MongoDB server.
2.2
Requires MongoDB 3.4 or greater
Represents credentials to authenticate to a MongoDB server, as well as the source of the credentials and the authentication mechanism to use.
Represents credentials to authenticate to a MongoDB server, as well as the source of the credentials and the authentication mechanism to use.
1.0
The options regarding collation support in MongoDB 3.4+
The options regarding collation support in MongoDB 3.4+
1.2
Requires MongoDB 3.4 or greater
Top level Exception for all Exceptions, server-side or client-side, that come from the driver.
A companion object for MongoNamespace
A companion object for MongoNamespace
1.0
A companion object for Observable
The readConcern option allows clients to choose a level of isolation for their reads.
The readConcern option allows clients to choose a level of isolation for their reads.
1.1
Requires MongoDB 3.2 or greater
The readConcern level of isolation for reads.
The readConcern level of isolation for reads.
1.1
Requires MongoDB 3.2 or greater
The preferred replica set members to which a query or command can be sent.
The preferred replica set members to which a query or command can be sent.
1.0
Represents the location of a MongoDB server - i.e.
Represents the location of a MongoDB server - i.e. server name and port number
1.0
A companion object for SingleObservable
A companion object for SingleObservable
2.0
A replica set tag.
An immutable set of tags, used to select members of a replica set to use for read operations.
The options to apply to transactions.
The options to apply to transactions.
2.4
TransactionOptions
Controls the acknowledgment of write operations with various options.
Controls the acknowledgment of write operations with various options.
w
- 0: Don't wait for acknowledgement from the server - 1: Wait for acknowledgement, but don't wait for secondaries to replicate - >=2: Wait for one or more secondaries to also acknowledge - "majority": Wait for a majority of secondaries to also acknowledge - "<tag set name>": Wait for one or more secondaries to also acknowledge based on a tag set name
wTimeout
- how long to wait for slaves before failing - 0: indefinite - >0: time to wait in milliseconds
- journal
: If true block until write operations have been committed to the journal. Cannot be used in combination with fsync
.
Prior to MongoDB 2.6 this option was ignored if the server was running without journaling. Starting with MongoDB 2.6
write operations will fail with an exception if this option is used when the server is running without journaling.
The ScalaWriteConcern implicit allows for chainable building of the WriteConcern eg:
val myWriteConcern = WriteConcern.ACKNOWLEDGED.withJournal(true)).withWTimeout(Duration(10, TimeUnit.MILLISECONDS))
1.0
Helper to get the class from a classTag
Helper to get the class from a classTag
the class type
the classTag we want to implicitly get the class of
the classOf[C]
The connection package contains classes that manage connecting to MongoDB servers.
The model package containing models and options that help describe MongoCollection
operations
This package contains the Key Vault API
This package contains the Key Vault API
2.7
The MongoDB Scala Driver package
Contains type aliases and companion objects to help when using the Scala API
1.0