Package | Description |
---|---|
com.mongodb |
Main package with core files.
|
Modifier and Type | Class and Description |
---|---|
static class |
WriteConcern.Majority
A write concern that blocks acknowledgement of a write operation until a majority of replica set members have applied it.
|
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
Deprecated.
There is no replacement for this write concern. The closest would be to use WriteConcern#UNACKNOWLEDGED,
then catch and ignore any exceptions of type MongoSocketException.
|
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
Deprecated.
|
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
Deprecated.
Sets the write concern.
|
Modifier and Type | Method and Description |
---|---|
WriteConcern |
WriteConcern.continueOnError(boolean continueOnError)
Deprecated.
the preferred way to specify this is to use write methods that explicitly specify the value of this property
|
WriteConcern |
WriteConcern.continueOnErrorForInsert(boolean continueOnErrorForInsert)
Deprecated.
the preferred way to specify this is to use write methods that explicitly specify the value of this property
|
WriteConcern |
WriteResult.getLastConcern()
Deprecated.
there is no replacement for this method
|
WriteConcern |
MongoOptions.getWriteConcern()
Deprecated.
Helper method to return the appropriate WriteConcern instance based on the current related options settings.
|
WriteConcern |
MongoClientOptions.getWriteConcern()
The write concern to use.
|
WriteConcern |
Mongo.getWriteConcern()
Gets the default write concern
|
WriteConcern |
InsertOptions.getWriteConcern()
The write concern to use for the insertion.
|
WriteConcern |
DBCollection.getWriteConcern()
Get the
WriteConcern for this collection. |
WriteConcern |
DB.getWriteConcern()
Gets the write concern for this database.
|
static WriteConcern |
WriteConcern.valueOf(String name)
Gets the WriteConcern constants by name (matching is done case insensitively).
|
Modifier and Type | Method and Description |
---|---|
BulkWriteResult |
BulkWriteOperation.execute(WriteConcern writeConcern)
Execute the bulk write operation with the given write concern.
|
CommandResult |
WriteResult.getLastError(WriteConcern concern)
Deprecated.
Use the appropriate
WriteConcern and rely on the write operation to throw an exception on failure. For
successful writes, use the helper methods to retrieve specific values from the write response. |
CommandResult |
DB.getLastError(WriteConcern concern)
Deprecated.
The getlasterror command will not be supported in future versions of MongoDB. Use acknowledged writes instead.
|
WriteResult |
DBCollection.insert(DBObject[] arr,
WriteConcern concern)
Insert documents into a collection.
|
WriteResult |
DBCollection.insert(DBObject[] arr,
WriteConcern concern,
DBEncoder encoder)
Insert documents into a collection.
|
WriteResult |
DBCollection.insert(DBObject o,
WriteConcern concern)
Insert a document into a collection.
|
WriteResult |
DBCollection.insert(List<DBObject> list,
WriteConcern concern)
Insert documents into a collection.
|
abstract WriteResult |
DBCollection.insert(List<DBObject> list,
WriteConcern concern,
DBEncoder encoder)
Insert documents into a collection.
|
WriteResult |
DBCollection.insert(WriteConcern concern,
DBObject... arr)
Insert documents into a collection.
|
WriteResult |
DBCollection.remove(DBObject o,
WriteConcern concern)
Remove documents from a collection.
|
abstract WriteResult |
DBCollection.remove(DBObject o,
WriteConcern concern,
DBEncoder encoder)
Remove documents from a collection.
|
WriteResult |
DBCollection.save(DBObject jo,
WriteConcern concern)
Update an existing document or insert a document depending on the parameter.
|
WriteResult |
DBTCPConnector.say(DB db,
com.mongodb.OutMessage m,
WriteConcern concern)
Deprecated.
|
WriteResult |
DBConnector.say(DB db,
com.mongodb.OutMessage m,
WriteConcern concern)
Deprecated.
does a write operation
|
WriteResult |
DBTCPConnector.say(DB db,
com.mongodb.OutMessage m,
WriteConcern concern,
ServerAddress hostNeeded)
Deprecated.
|
WriteResult |
DBConnector.say(DB db,
com.mongodb.OutMessage m,
WriteConcern concern,
ServerAddress hostNeeded)
Deprecated.
does a write operation
|
void |
MongoOptions.setWriteConcern(WriteConcern writeConcern)
Deprecated.
|
void |
Mongo.setWriteConcern(WriteConcern concern)
Sets the write concern for this database.
|
void |
DBCollection.setWriteConcern(WriteConcern writeConcern)
Set the
WriteConcern for this collection. |
void |
DB.setWriteConcern(WriteConcern writeConcern)
Sets the write concern for this database.
|
WriteResult |
DBCollection.update(DBObject q,
DBObject o,
boolean upsert,
boolean multi,
WriteConcern concern)
Modify an existing document or documents in collection.
|
abstract WriteResult |
DBCollection.update(DBObject q,
DBObject o,
boolean upsert,
boolean multi,
WriteConcern concern,
DBEncoder encoder)
Modify an existing document or documents in collection.
|
MongoClientOptions.Builder |
MongoClientOptions.Builder.writeConcern(WriteConcern writeConcern)
Sets the write concern.
|
InsertOptions |
InsertOptions.writeConcern(WriteConcern writeConcern)
Set the write concern to use for the insert.
|