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.binding |
This package contains classes that manage binding to MongoDB servers for various operations.
|
com.mongodb.client |
This package contains client interfaces
|
com.mongodb.client.gridfs |
This package contains the new GridFS implementation
|
com.mongodb.operation |
The core of the MongoDB driver works via operations, using the command pattern.
|
com.mongodb.selector |
Contains classes that determine how to select the server to connect to in order to send commands or queries.
|
Modifier and Type | Class and Description |
---|---|
class |
TaggableReadPreference
Abstract class for all preference which can be combined with tags
|
Modifier and Type | Field and Description |
---|---|
ReadPreference |
MongoOptions.readPreference
Deprecated.
Specifies the read preference.
|
Modifier and Type | Method and Description |
---|---|
ReadPreference |
MongoClientOptions.getReadPreference()
The read preference to use for queries, map-reduce, aggregation, and count.
|
ReadPreference |
DBCollection.getReadPreference()
Gets the
ReadPreference . |
ReadPreference |
DB.getReadPreference()
Gets the read preference for this database.
|
ReadPreference |
DBCursor.getReadPreference()
Gets the default read preference.
|
ReadPreference |
MapReduceCommand.getReadPreference()
Gets the read preference
|
ReadPreference |
Mongo.getReadPreference()
Gets the default read preference
|
ReadPreference |
ParallelScanOptions.getReadPreference()
Gets the read preference to use.
|
ReadPreference |
MongoOptions.getReadPreference()
Deprecated.
Gets the read preference.
|
ReadPreference |
ConnectionString.getReadPreference()
Gets the read preference specified in the connection string.
|
static ReadPreference |
ReadPreference.nearest()
Gets a read preference that forces reads to a primary or a secondary.
|
static ReadPreference |
ReadPreference.primary()
Gets a read preference that forces read to the primary.
|
static ReadPreference |
ReadPreference.primaryPreferred()
Gets a read preference that forces reads to the primary if available, otherwise to a secondary.
|
static ReadPreference |
ReadPreference.secondary()
Gets a read preference that forces reads to a secondary.
|
static ReadPreference |
ReadPreference.secondaryPreferred()
Gets a read preference that forces reads to a secondary if one is available, otherwise to the primary.
|
static ReadPreference |
ReadPreference.valueOf(String name)
Creates a read preference from the given read preference name.
|
Modifier and Type | Method and Description |
---|---|
Cursor |
DBCollection.aggregate(List<? extends DBObject> pipeline,
AggregationOptions options,
ReadPreference readPreference)
Method implements aggregation framework.
|
AggregationOutput |
DBCollection.aggregate(List<? extends DBObject> pipeline,
ReadPreference readPreference)
Method implements aggregation framework.
|
CommandResult |
DB.command(DBObject command,
ReadPreference readPreference)
Executes the command against the database with the given read preference.
|
CommandResult |
DB.command(DBObject command,
ReadPreference readPreference,
DBEncoder encoder)
Executes a database command with the selected readPreference, and encodes the command using the given encoder.
|
CommandResult |
DB.command(String command,
ReadPreference readPreference)
Executes a database command.
|
long |
DBCollection.count(DBObject query,
ReadPreference readPreference)
Get the count of documents in collection that would match a criteria.
|
List |
DBCollection.distinct(String fieldName,
DBObject query,
ReadPreference readPreference)
Find the distinct values for a specified field across a collection and returns the results in an array.
|
List |
DBCollection.distinct(String fieldName,
ReadPreference readPreference)
Find the distinct values for a specified field across a collection and returns the results in an array.
|
DBObject |
DBCollection.findOne(DBObject query,
DBObject projection,
DBObject sort,
ReadPreference readPreference)
Get a single document from collection.
|
DBObject |
DBCollection.findOne(DBObject query,
DBObject projection,
ReadPreference readPreference)
Get a single document from collection.
|
long |
DBCollection.getCount(DBObject query,
DBObject projection,
long limit,
long skip,
ReadPreference readPreference)
Get the count of documents in collection that would match a criteria.
|
long |
DBCollection.getCount(DBObject query,
DBObject projection,
ReadPreference readPreference)
Get the count of documents in collection that would match a criteria.
|
long |
DBCollection.getCount(ReadPreference readPreference)
Get the count of documents in collection.
|
DBObject |
DBCollection.group(DBObject key,
DBObject cond,
DBObject initial,
String reduce,
String finalize,
ReadPreference readPreference)
Group documents in a collection by the specified key and performs simple aggregation functions such as computing counts and sums.
|
DBObject |
DBCollection.group(GroupCommand cmd,
ReadPreference readPreference)
Group documents in a collection by the specified key and performs simple aggregation functions such as computing counts and sums.
|
MapReduceOutput |
DBCollection.mapReduce(String map,
String reduce,
String outputTarget,
MapReduceCommand.OutputType outputType,
DBObject query,
ReadPreference readPreference)
Allows you to run map-reduce aggregation operations over a collection and saves to a named collection.
|
MongoClientOptions.Builder |
MongoClientOptions.Builder.readPreference(ReadPreference readPreference)
Sets the read preference.
|
ParallelScanOptions.Builder |
ParallelScanOptions.Builder.readPreference(ReadPreference readPreference)
The read preference to use.
|
void |
DBCollection.setReadPreference(ReadPreference preference)
Sets the
ReadPreference for this collection. |
void |
DB.setReadPreference(ReadPreference readPreference)
Sets the read preference for this database.
|
DBCursor |
DBCursor.setReadPreference(ReadPreference readPreference)
Sets the read preference for this cursor.
|
void |
MapReduceCommand.setReadPreference(ReadPreference preference)
Sets the read preference for this command.
|
void |
Mongo.setReadPreference(ReadPreference readPreference)
Sets the read preference for this database.
|
void |
MongoOptions.setReadPreference(ReadPreference readPreference)
Deprecated.
Specifies the read preference.
|
Constructor and Description |
---|
DBCursor(DBCollection collection,
DBObject query,
DBObject fields,
ReadPreference readPreference)
Initializes a new database cursor.
|
Modifier and Type | Method and Description |
---|---|
ReadPreference |
MongoCollection.getReadPreference()
Get the read preference for the MongoCollection.
|
ReadPreference |
MongoDatabase.getReadPreference()
Get the read preference for the MongoDatabase.
|
ReadPreference |
MongoClientSettings.getReadPreference()
The read preference to use for queries, map-reduce, aggregation, and count.
|
Modifier and Type | Method and Description |
---|---|
MongoClientSettings.Builder |
MongoClientSettings.Builder.readPreference(ReadPreference readPreference)
Sets the read preference.
|
<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.
|
MongoCollection<TDocument> |
MongoCollection.withReadPreference(ReadPreference readPreference)
Create a new MongoCollection instance with a different read preference.
|
MongoDatabase |
MongoDatabase.withReadPreference(ReadPreference readPreference)
Create a new MongoDatabase instance with a different read preference.
|
Modifier and Type | Method and Description |
---|---|
ReadPreference |
AsyncReadBinding.getReadPreference()
The read preference that all connection sources returned by this instance will satisfy.
|
ReadPreference |
ReadBinding.getReadPreference()
The read preference that all connection sources returned by this instance will satisfy.
|
ReadPreference |
SingleServerBinding.getReadPreference() |
ReadPreference |
ClusterBinding.getReadPreference() |
ReadPreference |
AsyncSingleConnectionReadBinding.getReadPreference() |
ReadPreference |
AsyncClusterBinding.getReadPreference() |
ReadPreference |
SingleConnectionReadBinding.getReadPreference() |
Constructor and Description |
---|
AsyncClusterBinding(Cluster cluster,
ReadPreference readPreference)
Creates an instance.
|
AsyncSingleConnectionReadBinding(ReadPreference readPreference,
ServerDescription serverDescription,
AsyncConnection connection)
Construct an instance.
|
ClusterBinding(Cluster cluster,
ReadPreference readPreference)
Creates an instance.
|
SingleConnectionReadBinding(ReadPreference readPreference,
ServerDescription serverDescription,
Connection connection)
Construct an instance.
|
SingleServerBinding(Cluster cluster,
ServerAddress serverAddress,
ReadPreference readPreference)
Creates an instance.
|
Modifier and Type | Method and Description |
---|---|
ReadPreference |
MongoDatabase.getReadPreference()
Get the read preference for the MongoDatabase.
|
ReadPreference |
MongoCollection.getReadPreference()
Get the read preference for the MongoCollection.
|
Modifier and Type | Method and Description |
---|---|
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.
|
MongoDatabase |
MongoDatabase.withReadPreference(ReadPreference readPreference)
Create a new MongoDatabase instance with a different read preference.
|
MongoCollection<TDocument> |
MongoCollection.withReadPreference(ReadPreference readPreference)
Create a new MongoCollection instance with a different read preference.
|
Modifier and Type | Method and Description |
---|---|
ReadPreference |
GridFSBucket.getReadPreference()
Get the read preference for the GridFSBucket.
|
Modifier and Type | Method and Description |
---|---|
GridFSBucket |
GridFSBucket.withReadPreference(ReadPreference readPreference)
Create a new GridFSBucket instance with a different read preference.
|
Modifier and Type | Method and Description |
---|---|
<T> void |
AsyncOperationExecutor.execute(AsyncReadOperation<T> operation,
ReadPreference readPreference,
SingleResultCallback<T> callback)
Execute the read operation with the given read preference.
|
<T> T |
OperationExecutor.execute(ReadOperation<T> operation,
ReadPreference readPreference)
Execute the read operation with the given read preference.
|
Modifier and Type | Method and Description |
---|---|
ReadPreference |
ReadPreferenceServerSelector.getReadPreference()
Gets the read preference.
|
Constructor and Description |
---|
ReadPreferenceServerSelector(ReadPreference readPreference)
Gets the read preference.
|
Copyright © 2016. All Rights Reserved.