Package | Description |
---|---|
com.mongodb |
Main package with core files.
|
Modifier and Type | Class and Description |
---|---|
static class |
ReadPreference.TaggedReadPreference
Deprecated.
As of release 2.9, replaced by
secondaryPreferred(DBObject, DBObject...) |
class |
TaggableReadPreference
Abstract class for all preference which can be combined with tags
|
Modifier and Type | Field and Description |
---|---|
static ReadPreference |
ReadPreference.PRIMARY
Deprecated.
As of release 2.9.0, replaced by
ReadPreference.primary() |
ReadPreference |
MongoOptions.readPreference
Deprecated.
Specifies the read preference.
|
static ReadPreference |
ReadPreference.SECONDARY
Deprecated.
As of release 2.9.0, replaced by
ReadPreference.secondaryPreferred() |
Modifier and Type | Method and Description |
---|---|
ReadPreference |
ParallelScanOptions.getReadPreference()
Gets the read preference to use.
|
ReadPreference |
MongoOptions.getReadPreference()
Deprecated.
|
ReadPreference |
MongoClientOptions.getReadPreference()
The read preference to use for queries, map-reduce, aggregation, and count.
|
ReadPreference |
Mongo.getReadPreference()
Gets the default read preference
|
ReadPreference |
MapReduceCommand.getReadPreference()
Gets the read preference
|
ReadPreference |
DBCursor.getReadPreference()
Gets the default read preference.
|
ReadPreference |
DBCollection.getReadPreference()
Gets the
ReadPreference . |
ReadPreference |
DB.getReadPreference()
Gets the read preference for this database.
|
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.
|
static ReadPreference |
ReadPreference.withTags(DBObject tags)
Deprecated.
As of release 2.9.0, replaced by
ReadPreference.secondaryPreferred(DBObject firstTagSet, DBObject... remainingTagSets) |
static ReadPreference |
ReadPreference.withTags(Map<String,String> tags)
Deprecated.
As of release 2.9.0, replaced by
ReadPreference.secondaryPreferred(DBObject firstTagSet, DBObject... remainingTagSets) |
Modifier and Type | Method and Description |
---|---|
abstract Cursor |
DBCollection.aggregate(List<DBObject> pipeline,
AggregationOptions options,
ReadPreference readPreference)
Method implements aggregation framework.
|
AggregationOutput |
DBCollection.aggregate(List<DBObject> pipeline,
ReadPreference readPreference)
Method implements aggregation framework.
|
com.mongodb.Response |
DBTCPConnector.call(DB db,
DBCollection coll,
com.mongodb.OutMessage m,
ServerAddress hostNeeded,
int retries,
ReadPreference readPref,
DBDecoder decoder)
Deprecated.
|
com.mongodb.Response |
DBConnector.call(DB db,
DBCollection coll,
com.mongodb.OutMessage m,
ServerAddress hostNeeded,
int retries,
ReadPreference readPref,
DBDecoder decoder)
Deprecated.
does a read operation on the database
|
CommandResult |
DB.command(DBObject cmd,
int options,
ReadPreference readPreference)
Deprecated.
Use
DB.command(DBObject, ReadPreference) instead. This method will be removed in 3.0. |
CommandResult |
DB.command(DBObject cmd,
int options,
ReadPreference readPreference,
DBEncoder encoder)
Deprecated.
Use
DB.command(DBObject, ReadPreference, DBEncoder) instead. This method will be removed in 3.0. |
CommandResult |
DB.command(DBObject cmd,
ReadPreference readPreference)
Executes the command against the database with the given read preference.
|
CommandResult |
DB.command(DBObject cmd,
ReadPreference readPreference,
DBEncoder encoder)
Executes a database command with the selected readPreference, and encodes the command using the given encoder.
|
CommandResult |
DB.command(String cmd,
ReadPreference readPreference)
Executes a database command.
|
long |
DBCollection.count(DBObject query,
ReadPreference readPrefs)
Get the count of documents in collection that would match a criteria.
|
List |
DBCollection.distinct(String key,
DBObject query,
ReadPreference readPrefs)
Find the distinct values for a specified field across a collection and returns the results in an array.
|
List |
DBCollection.distinct(String key,
ReadPreference readPrefs)
Find the distinct values for a specified field across a collection and returns the results in an array.
|
DBObject |
DBCollection.findOne(DBObject o,
DBObject fields,
DBObject orderBy,
ReadPreference readPref)
Get a single document from collection.
|
DBObject |
DBCollection.findOne(DBObject o,
DBObject fields,
ReadPreference readPref)
Get a single document from collection.
|
long |
DBCollection.getCount(DBObject query,
DBObject fields,
long limit,
long skip,
ReadPreference readPrefs)
Get the count of documents in collection that would match a criteria.
|
long |
DBCollection.getCount(DBObject query,
DBObject fields,
ReadPreference readPrefs)
Get the count of documents in collection that would match a criteria.
|
long |
DBCollection.getCount(ReadPreference readPrefs)
Get the count of documents in a collection.
|
DBObject |
DBCollection.group(DBObject key,
DBObject cond,
DBObject initial,
String reduce,
String finalize,
ReadPreference readPrefs)
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 readPrefs)
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 readPrefs)
Allows you to run map-reduce aggregation operations over a collection and saves to a named collection.
|
ParallelScanOptions.Builder |
ParallelScanOptions.Builder.readPreference(ReadPreference readPreference)
The read preference to use.
|
MongoClientOptions.Builder |
MongoClientOptions.Builder.readPreference(ReadPreference readPreference)
Sets the read preference.
|
void |
MongoOptions.setReadPreference(ReadPreference readPreference)
Deprecated.
|
void |
Mongo.setReadPreference(ReadPreference preference)
Sets the read preference for this database.
|
void |
MapReduceCommand.setReadPreference(ReadPreference preference)
Sets the read preference for this command.
|
DBCursor |
DBCursor.setReadPreference(ReadPreference readPreference)
Sets the read preference for this cursor.
|
void |
DBCollection.setReadPreference(ReadPreference preference)
Sets the
ReadPreference for this collection. |
void |
DB.setReadPreference(ReadPreference readPreference)
Sets the read preference for this database.
|
Constructor and Description |
---|
DBCursor(DBCollection collection,
DBObject q,
DBObject k,
ReadPreference preference)
Initializes a new database cursor.
|