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.client |
This package contains client interfaces
|
com.mongodb.client.gridfs |
This package contains the new GridFS implementation
|
com.mongodb.connection |
Contains classes that manage connecting to MongoDB servers.
|
com.mongodb.operation |
The core of the MongoDB driver works via operations, using the command pattern.
|
Modifier and Type | Class and Description |
---|---|
static class |
WriteConcern.Majority
Deprecated.
|
Modifier and Type | Field and Description |
---|---|
static WriteConcern |
WriteConcern.ACKNOWLEDGED
Write operations that use this write concern will wait for acknowledgement, using the default write concern configured on the server.
|
static WriteConcern |
WriteConcern.FSYNC_SAFE
Deprecated.
Prefer
JOURNALED |
static WriteConcern |
WriteConcern.FSYNCED
Deprecated.
Prefer
JOURNALED |
static WriteConcern |
WriteConcern.JOURNAL_SAFE
Deprecated.
Prefer
JOURNALED |
static WriteConcern |
WriteConcern.JOURNALED
Write operations wait 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.NORMAL
Deprecated.
Prefer
UNACKNOWLEDGED |
static WriteConcern |
WriteConcern.REPLICA_ACKNOWLEDGED
Deprecated.
Prefer WriteConcern#W2
|
static WriteConcern |
WriteConcern.REPLICAS_SAFE
Deprecated.
Prefer
W2 |
static WriteConcern |
WriteConcern.SAFE
Deprecated.
Prefer
ACKNOWLEDGED |
static WriteConcern |
WriteConcern.UNACKNOWLEDGED
Write operations that use this write concern will return as soon as the message is written to the socket.
|
static WriteConcern |
WriteConcern.W1
Write operations that use this write concern will wait for acknowledgement from a single member.
|
static WriteConcern |
WriteConcern.W2
Write operations that use this write concern will wait for acknowledgement from two members.
|
static WriteConcern |
WriteConcern.W3
Write operations that use this write concern will wait for acknowledgement from three members.
|
WriteConcern |
MongoOptions.writeConcern
Deprecated.
Sets the write concern.
|
Modifier and Type | Method and Description |
---|---|
WriteConcern |
MongoClientOptions.getWriteConcern()
The write concern to use.
|
WriteConcern |
DBCollection.getWriteConcern()
Get the
WriteConcern for this collection. |
WriteConcern |
DB.getWriteConcern()
Gets the write concern for this database.
|
WriteConcern |
InsertOptions.getWriteConcern()
The write concern to use for the insertion.
|
WriteConcern |
Mongo.getWriteConcern()
Gets the write concern
|
WriteConcern |
MongoOptions.getWriteConcern()
Deprecated.
Helper method to return the appropriate WriteConcern instance based on the current related options settings.
|
WriteConcern |
ConnectionString.getWriteConcern()
Gets the write concern specified in the connection string.
|
static WriteConcern |
WriteConcern.valueOf(String name)
Gets the WriteConcern constants by name (matching is done case insensitively).
|
WriteConcern |
WriteConcern.withFsync(boolean fsync)
Deprecated.
Prefer
withJournal(Boolean) |
WriteConcern |
WriteConcern.withJ(boolean journal)
Deprecated.
Prefer
withJournal(Boolean) |
WriteConcern |
WriteConcern.withJournal(Boolean journal)
Constructs a new WriteConcern from the current one and the specified journal value
|
WriteConcern |
WriteConcern.withW(int w)
Constructs a new WriteConcern from the current one and the specified integer-based value for w
|
WriteConcern |
WriteConcern.withW(String w)
Constructs a new WriteConcern from the current one and the specified tag-set based value for w
|
WriteConcern |
WriteConcern.withWTimeout(long wTimeout,
TimeUnit timeUnit)
Constructs a new WriteConcern from the current one and the specified wTimeout in the given time unit.
|
Modifier and Type | Method and Description |
---|---|
BulkWriteResult |
BulkWriteOperation.execute(WriteConcern writeConcern)
Execute the bulk write operation with the given write concern.
|
DBObject |
DBCollection.findAndModify(DBObject query,
DBObject fields,
DBObject sort,
boolean remove,
DBObject update,
boolean returnNew,
boolean upsert,
boolean bypassDocumentValidation,
long maxTime,
TimeUnit maxTimeUnit,
WriteConcern writeConcern)
Atomically modify and return a single document.
|
DBObject |
DBCollection.findAndModify(DBObject query,
DBObject fields,
DBObject sort,
boolean remove,
DBObject update,
boolean returnNew,
boolean upsert,
long maxTime,
TimeUnit maxTimeUnit,
WriteConcern writeConcern)
Atomically modify and return a single document.
|
DBObject |
DBCollection.findAndModify(DBObject query,
DBObject fields,
DBObject sort,
boolean remove,
DBObject update,
boolean returnNew,
boolean upsert,
WriteConcern writeConcern)
Atomically modify and return a single document.
|
WriteResult |
DBCollection.insert(DBObject[] documents,
WriteConcern writeConcern)
Insert documents into a collection.
|
WriteResult |
DBCollection.insert(DBObject[] documents,
WriteConcern aWriteConcern,
DBEncoder encoder)
Insert documents into a collection.
|
WriteResult |
DBCollection.insert(DBObject document,
WriteConcern writeConcern)
Insert a document into a collection.
|
WriteResult |
DBCollection.insert(List<? extends DBObject> documents,
WriteConcern aWriteConcern)
Insert documents into a collection.
|
WriteResult |
DBCollection.insert(List<? extends DBObject> documents,
WriteConcern aWriteConcern,
DBEncoder dbEncoder)
Insert documents into a collection.
|
WriteResult |
DBCollection.insert(WriteConcern writeConcern,
DBObject... documents)
Insert documents into a collection.
|
WriteResult |
DBCollection.remove(DBObject query,
WriteConcern writeConcern)
Remove documents from a collection.
|
WriteResult |
DBCollection.remove(DBObject query,
WriteConcern writeConcern,
DBEncoder encoder)
Remove documents from a collection.
|
WriteResult |
DBCollection.save(DBObject document,
WriteConcern writeConcern)
Update an existing document or insert a document depending on the parameter.
|
void |
DBCollection.setWriteConcern(WriteConcern writeConcern)
Set the
WriteConcern for this collection. |
void |
DB.setWriteConcern(WriteConcern writeConcern)
Sets the write concern for this database.
|
void |
Mongo.setWriteConcern(WriteConcern writeConcern)
Sets the write concern for this database.
|
void |
MongoOptions.setWriteConcern(WriteConcern writeConcern)
Deprecated.
Sets the write concern.
|
WriteResult |
DBCollection.update(DBObject query,
DBObject update,
boolean upsert,
boolean multi,
WriteConcern aWriteConcern)
Modify an existing document or documents in collection.
|
WriteResult |
DBCollection.update(DBObject query,
DBObject update,
boolean upsert,
boolean multi,
WriteConcern concern,
boolean bypassDocumentValidation,
DBEncoder encoder)
Modify an existing document or documents in collection.
|
WriteResult |
DBCollection.update(DBObject query,
DBObject update,
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.
|
Modifier and Type | Method and Description |
---|---|
WriteConcern |
MongoCollection.getWriteConcern()
Get the write concern for the MongoCollection.
|
WriteConcern |
MongoDatabase.getWriteConcern()
Get the write concern for the MongoDatabase.
|
WriteConcern |
MongoClientSettings.getWriteConcern()
The write concern to use.
|
Modifier and Type | Method and Description |
---|---|
MongoCollection<TDocument> |
MongoCollection.withWriteConcern(WriteConcern writeConcern)
Create a new MongoCollection instance with a different write concern.
|
MongoDatabase |
MongoDatabase.withWriteConcern(WriteConcern writeConcern)
Create a new MongoDatabase instance with a different write concern.
|
MongoClientSettings.Builder |
MongoClientSettings.Builder.writeConcern(WriteConcern writeConcern)
Sets the write concern.
|
Modifier and Type | Method and Description |
---|---|
WriteConcern |
MongoDatabase.getWriteConcern()
Get the write concern for the MongoDatabase.
|
WriteConcern |
MongoCollection.getWriteConcern()
Get the write concern for the MongoCollection.
|
Modifier and Type | Method and Description |
---|---|
MongoDatabase |
MongoDatabase.withWriteConcern(WriteConcern writeConcern)
Create a new MongoDatabase instance with a different write concern.
|
MongoCollection<TDocument> |
MongoCollection.withWriteConcern(WriteConcern writeConcern)
Create a new MongoCollection instance with a different write concern.
|
Modifier and Type | Method and Description |
---|---|
WriteConcern |
GridFSBucket.getWriteConcern()
Get the write concern for the GridFSBucket.
|
Modifier and Type | Method and Description |
---|---|
GridFSBucket |
GridFSBucket.withWriteConcern(WriteConcern writeConcern)
Create a new GridFSBucket instance with a different write concern.
|
Modifier and Type | Method and Description |
---|---|
WriteConcernResult |
Connection.delete(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<DeleteRequest> deletes)
Delete the documents using the delete wire protocol and apply the write concern.
|
void |
AsyncConnection.deleteAsync(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<DeleteRequest> deletes,
SingleResultCallback<WriteConcernResult> callback)
Delete the documents using the delete wire protocol and apply the write concern asynchronously.
|
BulkWriteResult |
Connection.deleteCommand(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<DeleteRequest> deletes)
Delete the documents using the delete command.
|
void |
AsyncConnection.deleteCommandAsync(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<DeleteRequest> deletes,
SingleResultCallback<BulkWriteResult> callback)
Delete the documents using the delete command asynchronously.
|
WriteConcernResult |
Connection.insert(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<InsertRequest> inserts)
Insert the documents using the insert wire protocol and apply the write concern.
|
void |
AsyncConnection.insertAsync(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<InsertRequest> inserts,
SingleResultCallback<WriteConcernResult> callback)
Insert the documents using the insert wire protocol and apply the write concern asynchronously.
|
BulkWriteResult |
Connection.insertCommand(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
Boolean bypassDocumentValidation,
List<InsertRequest> inserts)
Insert the documents using the insert command.
|
BulkWriteResult |
Connection.insertCommand(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<InsertRequest> inserts)
Deprecated.
|
void |
AsyncConnection.insertCommandAsync(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
Boolean bypassDocumentValidation,
List<InsertRequest> inserts,
SingleResultCallback<BulkWriteResult> callback)
Insert the documents using the insert command asynchronously.
|
void |
AsyncConnection.insertCommandAsync(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<InsertRequest> inserts,
SingleResultCallback<BulkWriteResult> callback)
|
WriteConcernResult |
Connection.update(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<UpdateRequest> updates)
Update the documents using the update wire protocol and apply the write concern.
|
void |
AsyncConnection.updateAsync(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<UpdateRequest> updates,
SingleResultCallback<WriteConcernResult> callback)
Update the documents using the update wire protocol and apply the write concern asynchronously.
|
BulkWriteResult |
Connection.updateCommand(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
Boolean bypassDocumentValidation,
List<UpdateRequest> updates)
Update the documents using the update command.
|
BulkWriteResult |
Connection.updateCommand(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<UpdateRequest> updates)
Deprecated.
|
void |
AsyncConnection.updateCommandAsync(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
Boolean bypassDocumentValidation,
List<UpdateRequest> updates,
SingleResultCallback<BulkWriteResult> callback)
Update the documents using the update command asynchronously.
|
void |
AsyncConnection.updateCommandAsync(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<UpdateRequest> updates,
SingleResultCallback<BulkWriteResult> callback)
|
Constructor and Description |
---|
BulkWriteBatchCombiner(ServerAddress serverAddress,
boolean ordered,
WriteConcern writeConcern)
Construct an instance.
|
Modifier and Type | Method and Description |
---|---|
WriteConcern |
FindAndDeleteOperation.getWriteConcern()
Get the write concern for this operation
|
WriteConcern |
BaseWriteOperation.getWriteConcern()
Gets the write concern to apply
|
WriteConcern |
MixedBulkWriteOperation.getWriteConcern()
Gets the write concern to apply
|
WriteConcern |
FindAndUpdateOperation.getWriteConcern()
Get the write concern for this operation
|
WriteConcern |
FindAndReplaceOperation.getWriteConcern()
Get the write concern for this operation
|
Constructor and Description |
---|
BaseWriteOperation(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern)
Construct an instance
|
DeleteOperation(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<DeleteRequest> deleteRequests)
Construct an instance.
|
FindAndDeleteOperation(MongoNamespace namespace,
WriteConcern writeConcern,
Decoder<T> decoder)
Construct a new instance.
|
FindAndReplaceOperation(MongoNamespace namespace,
WriteConcern writeConcern,
Decoder<T> decoder,
BsonDocument replacement)
Construct a new instance.
|
FindAndUpdateOperation(MongoNamespace namespace,
WriteConcern writeConcern,
Decoder<T> decoder,
BsonDocument update)
Construct a new instance.
|
InsertOperation(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<InsertRequest> insertRequests)
Construct an instance.
|
MixedBulkWriteOperation(MongoNamespace namespace,
List<? extends WriteRequest> writeRequests,
boolean ordered,
WriteConcern writeConcern)
Construct a new instance.
|
UpdateOperation(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<UpdateRequest> updates)
Construct an instance.
|
Copyright © 2016. All Rights Reserved.