@ThreadSafe public interface Connection extends ReferenceCounted
Implementations of this class are thread safe.
| Modifier and Type | Method and Description |
|---|---|
<T> T |
command(String database,
BsonDocument command,
boolean slaveOk,
FieldNameValidator fieldNameValidator,
Decoder<T> commandResultDecoder)
Execute the command.
|
WriteConcernResult |
delete(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<DeleteRequest> deletes)
Delete the documents using the delete wire protocol and apply the write concern.
|
BulkWriteResult |
deleteCommand(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<DeleteRequest> deletes)
Delete the documents using the delete command.
|
ConnectionDescription |
getDescription()
Gets the description of the connection.
|
<T> QueryResult<T> |
getMore(MongoNamespace namespace,
long cursorId,
int numberToReturn,
Decoder<T> resultDecoder)
Get more result documents from a cursor.
|
WriteConcernResult |
insert(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<InsertRequest> inserts)
Insert the documents using the insert wire protocol and apply the write concern.
|
BulkWriteResult |
insertCommand(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<InsertRequest> inserts)
Insert the documents using the insert command.
|
void |
killCursor(List<Long> cursors)
Kills the given list of cursors.
|
<T> QueryResult<T> |
query(MongoNamespace namespace,
BsonDocument queryDocument,
BsonDocument fields,
int numberToReturn,
int skip,
boolean slaveOk,
boolean tailableCursor,
boolean awaitData,
boolean noCursorTimeout,
boolean partial,
boolean oplogReplay,
Decoder<T> resultDecoder)
Execute the query.
|
Connection |
retain()
Retain an additional reference to this object.
|
WriteConcernResult |
update(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<UpdateRequest> updates)
Update the documents using the update wire protocol and apply the write concern.
|
BulkWriteResult |
updateCommand(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<UpdateRequest> updates)
Update the documents using the update command.
|
getCount, releaseConnection retain()
ReferenceCountedretain in interface ReferenceCountedConnectionDescription getDescription()
WriteConcernResult insert(MongoNamespace namespace, boolean ordered, WriteConcern writeConcern, List<InsertRequest> inserts)
namespace - the namespaceordered - whether the writes are orderedwriteConcern - the write concerninserts - the insertsWriteConcernResult update(MongoNamespace namespace, boolean ordered, WriteConcern writeConcern, List<UpdateRequest> updates)
namespace - the namespaceordered - whether the writes are orderedwriteConcern - the write concernupdates - the updatesWriteConcernResult delete(MongoNamespace namespace, boolean ordered, WriteConcern writeConcern, List<DeleteRequest> deletes)
namespace - the namespaceordered - whether the writes are orderedwriteConcern - the write concerndeletes - the deletesBulkWriteResult insertCommand(MongoNamespace namespace, boolean ordered, WriteConcern writeConcern, List<InsertRequest> inserts)
namespace - the namespaceordered - whether the writes are orderedwriteConcern - the write concerninserts - the insertsBulkWriteResult updateCommand(MongoNamespace namespace, boolean ordered, WriteConcern writeConcern, List<UpdateRequest> updates)
namespace - the namespaceordered - whether the writes are orderedwriteConcern - the write concernupdates - the updatesBulkWriteResult deleteCommand(MongoNamespace namespace, boolean ordered, WriteConcern writeConcern, List<DeleteRequest> deletes)
namespace - the namespaceordered - whether the writes are orderedwriteConcern - the write concerndeletes - the deletes<T> T command(String database, BsonDocument command, boolean slaveOk, FieldNameValidator fieldNameValidator, Decoder<T> commandResultDecoder)
T - the type of the resultdatabase - the database to execute the command incommand - the command documentslaveOk - whether the command can run on a secondaryfieldNameValidator - the field name validator for the command documentcommandResultDecoder - the decoder for the result<T> QueryResult<T> query(MongoNamespace namespace, BsonDocument queryDocument, BsonDocument fields, int numberToReturn, int skip, boolean slaveOk, boolean tailableCursor, boolean awaitData, boolean noCursorTimeout, boolean partial, boolean oplogReplay, Decoder<T> resultDecoder)
T - the query result document typenamespace - the namespace to queryqueryDocument - the query documentfields - the field to include or excludenumberToReturn - the number of documents to returnskip - the number of documents to skipslaveOk - whether the query can run on a secondarytailableCursor - whether to return a tailable cursorawaitData - whether a tailable cursor should wait before returning if no documents are availablenoCursorTimeout - whether the cursor should not timeoutpartial - whether partial results from sharded clusters are acceptableoplogReplay - whether to replay the oplogresultDecoder - the decoder for the query result documents<T> QueryResult<T> getMore(MongoNamespace namespace, long cursorId, int numberToReturn, Decoder<T> resultDecoder)
T - the type of the query result documentsnamespace - the namespace to get more documents fromcursorId - the cursor idnumberToReturn - the number of documents to returnresultDecoder - the decoder for the query results