Package | Description |
---|---|
com.mongodb |
Main package with core files.
|
Modifier and Type | Class and Description |
---|---|
static class |
WriteConcern.Majority |
Modifier and Type | Field and Description |
---|---|
static WriteConcern |
WriteConcern.ACKNOWLEDGED
Write operations that use this write concern will wait for acknowledgement from the primary server before returning.
|
static WriteConcern |
WriteConcern.ERRORS_IGNORED
No exceptions are raised, even for network issues.
|
static WriteConcern |
WriteConcern.FSYNC_SAFE
Exceptions are raised for network issues, and server errors; the write operation waits for the server to flush
the data to disk.
|
static WriteConcern |
WriteConcern.FSYNCED
Exceptions are raised for network issues, and server errors; the write operation waits for the server to flush
the data to disk.
|
static WriteConcern |
WriteConcern.JOURNAL_SAFE
Exceptions are raised for network issues, and server errors; the write operation waits for the server to
group commit to the journal file on disk.
|
static WriteConcern |
WriteConcern.JOURNALED
Exceptions are raised for network issues, and server errors; the write operation waits for the server to
group commit to the journal file on disk.
|
static WriteConcern |
WriteConcern.MAJORITY
Exceptions are raised for network issues, and server errors; waits on a majority of servers for the write operation.
|
static WriteConcern |
WriteConcern.NONE
No exceptions are raised, even for network issues.
|
static WriteConcern |
WriteConcern.NORMAL
Write operations that use this write concern will return as soon as the message is written to the socket.
|
static WriteConcern |
WriteConcern.REPLICA_ACKNOWLEDGED
Exceptions are raised for network issues, and server errors; waits for at least 2 servers for the write operation.
|
static WriteConcern |
WriteConcern.REPLICAS_SAFE
Exceptions are raised for network issues, and server errors; waits for at least 2 servers for the write operation.
|
static WriteConcern |
WriteConcern.SAFE
Write operations that use this write concern will wait for acknowledgement from the primary server before returning.
|
static WriteConcern |
WriteConcern.UNACKNOWLEDGED
Write operations that use this write concern will return as soon as the message is written to the socket.
|
WriteConcern |
MongoOptions.writeConcern
Sets the write concern.
|
Modifier and Type | Method and Description |
---|---|
WriteConcern |
WriteConcern.continueOnErrorForInsert(boolean continueOnErrorForInsert)
Toggles the "continue inserts on error" mode.
|
WriteConcern |
WriteResult.getLastConcern()
Gets the last
WriteConcern used when calling getLastError() |
WriteConcern |
MongoClientOptions.getWriteConcern()
The write concern to use.
|
WriteConcern |
DB.getWriteConcern()
Gets the write concern for this database.
|
WriteConcern |
Mongo.getWriteConcern()
Gets the default write concern
|
WriteConcern |
MongoOptions.getWriteConcern()
Helper method to return the appropriate WriteConcern instance based on the current related options settings.
|
WriteConcern |
DBCollection.getWriteConcern()
Get the write concern for this collection.
|
static WriteConcern |
WriteConcern.valueOf(String name)
Gets the WriteConcern constants by name: NONE, NORMAL, SAFE, FSYNC_SAFE,
REPLICA_SAFE.
|
Modifier and Type | Method and Description |
---|---|
CommandResult |
DB.getLastError(WriteConcern concern) |
CommandResult |
WriteResult.getLastError(WriteConcern concern)
This method does following:
- returns the existing CommandResult if concern is null or less strict than the concern it was obtained with
- otherwise attempts to obtain a CommandResult by calling getLastError with the concern
|
WriteResult |
DBCollection.insert(DBObject[] arr,
WriteConcern concern)
Saves document(s) to the database.
|
WriteResult |
DBCollection.insert(DBObject[] arr,
WriteConcern concern,
DBEncoder encoder)
Saves document(s) to the database.
|
WriteResult |
DBCollection.insert(DBObject o,
WriteConcern concern)
Inserts a document into the database.
|
WriteResult |
DBCollection.insert(List<DBObject> list,
WriteConcern concern)
Saves document(s) to the database.
|
abstract WriteResult |
DBCollection.insert(List<DBObject> list,
WriteConcern concern,
DBEncoder encoder)
Saves document(s) to the database.
|
WriteResult |
DBCollection.insert(WriteConcern concern,
DBObject... arr)
Saves document(s) to the database.
|
WriteResult |
DBCollection.remove(DBObject o,
WriteConcern concern)
Removes objects from the database collection.
|
abstract WriteResult |
DBCollection.remove(DBObject o,
WriteConcern concern,
DBEncoder encoder)
Removes objects from the database collection.
|
WriteResult |
DBCollection.save(DBObject jo,
WriteConcern concern)
Saves an object to this collection (does insert or update based on the object _id).
|
WriteResult |
DBTCPConnector.say(DB db,
com.mongodb.OutMessage m,
WriteConcern concern) |
WriteResult |
DBConnector.say(DB db,
com.mongodb.OutMessage m,
WriteConcern concern)
does a write operation
|
WriteResult |
DBTCPConnector.say(DB db,
com.mongodb.OutMessage m,
WriteConcern concern,
ServerAddress hostNeeded) |
WriteResult |
DBConnector.say(DB db,
com.mongodb.OutMessage m,
WriteConcern concern,
ServerAddress hostNeeded)
does a write operation
|
void |
DB.setWriteConcern(WriteConcern concern)
Sets the write concern for this database.
|
void |
Mongo.setWriteConcern(WriteConcern concern)
Sets the write concern for this database.
|
void |
MongoOptions.setWriteConcern(WriteConcern writeConcern) |
void |
DBCollection.setWriteConcern(WriteConcern concern)
Set the write concern for this collection.
|
WriteResult |
DBCollection.update(DBObject q,
DBObject o,
boolean upsert,
boolean multi,
WriteConcern concern)
Performs an update operation.
|
abstract WriteResult |
DBCollection.update(DBObject q,
DBObject o,
boolean upsert,
boolean multi,
WriteConcern concern,
DBEncoder encoder)
Performs an update operation.
|
MongoClientOptions.Builder |
MongoClientOptions.Builder.writeConcern(WriteConcern writeConcern)
Sets the write concern.
|