Package org.restheart.mongodb.db
Class DocumentDAO
java.lang.Object
org.restheart.mongodb.db.DocumentDAO
- All Implemented Interfaces:
DocumentRepository
- Author:
- Andrea Di Cesare <andrea@softinstigate.com>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbulkDeleteDocuments(com.mongodb.client.ClientSession cs, String dbName, String collName, org.bson.BsonDocument filter, org.bson.BsonDocument shardedKeys)bulkPatchDocuments(com.mongodb.client.ClientSession cs, String dbName, String collName, org.bson.BsonDocument filter, org.bson.BsonDocument shardedKeys, org.bson.BsonDocument data)bulkPostDocuments(com.mongodb.client.ClientSession cs, String dbName, String collName, org.bson.BsonArray documents, org.bson.BsonDocument filter, org.bson.BsonDocument shardKeys, ExchangeKeys.WRITE_MODE writeMode)deleteDocument(com.mongodb.client.ClientSession cs, String dbName, String collName, Object documentId, org.bson.BsonDocument filter, org.bson.BsonDocument shardedKeys, String requestEtag, boolean checkEtag)org.bson.BsonDocumentgetDocumentEtag(com.mongodb.client.ClientSession cs, String dbName, String collName, Object documentId)returns the ETag of the documentwriteDocument(com.mongodb.client.ClientSession cs, String dbName, String collName, Object documentId, org.bson.BsonDocument filter, org.bson.BsonDocument shardKeys, org.bson.BsonDocument newContent, String requestEtag, boolean patching, ExchangeKeys.WRITE_MODE writeMode, boolean checkEtag)writeDocumentPost(com.mongodb.client.ClientSession cs, String dbName, String collName, org.bson.BsonDocument filter, org.bson.BsonDocument shardKeys, org.bson.BsonDocument content, ExchangeKeys.WRITE_MODE writeMode, String requestEtag, boolean checkEtag)
-
Constructor Details
-
DocumentDAO
public DocumentDAO()
-
-
Method Details
-
getDocumentEtag
public org.bson.BsonDocument getDocumentEtag(com.mongodb.client.ClientSession cs, String dbName, String collName, Object documentId)Description copied from interface:DocumentRepositoryreturns the ETag of the document- Specified by:
getDocumentEtagin interfaceDocumentRepository- Parameters:
cs- the client sessiondbName-collName-documentId-- Returns:
-
writeDocument
public OperationResult writeDocument(com.mongodb.client.ClientSession cs, String dbName, String collName, Object documentId, org.bson.BsonDocument filter, org.bson.BsonDocument shardKeys, org.bson.BsonDocument newContent, String requestEtag, boolean patching, ExchangeKeys.WRITE_MODE writeMode, boolean checkEtag)- Specified by:
writeDocumentin interfaceDocumentRepository- Parameters:
cs- the client sessiondbName-collName-documentId-shardKeys-newContent-requestEtag-patching-writeMode-checkEtag-- Returns:
- the HttpStatus code
-
writeDocumentPost
public OperationResult writeDocumentPost(com.mongodb.client.ClientSession cs, String dbName, String collName, org.bson.BsonDocument filter, org.bson.BsonDocument shardKeys, org.bson.BsonDocument content, ExchangeKeys.WRITE_MODE writeMode, String requestEtag, boolean checkEtag)- Specified by:
writeDocumentPostin interfaceDocumentRepository- Parameters:
cs- the client sessiondbName-collName-shardKeys-content-writeMode-requestEtag-checkEtag-- Returns:
- the OperationResult
-
bulkPostDocuments
public BulkOperationResult bulkPostDocuments(com.mongodb.client.ClientSession cs, String dbName, String collName, org.bson.BsonArray documents, org.bson.BsonDocument filter, org.bson.BsonDocument shardKeys, ExchangeKeys.WRITE_MODE writeMode)- Specified by:
bulkPostDocumentsin interfaceDocumentRepository- Parameters:
cs- the client sessiondbName-collName-documents-shardKeys-writeMode-- Returns:
- the BulkOperationResult
-
bulkPatchDocuments
public BulkOperationResult bulkPatchDocuments(com.mongodb.client.ClientSession cs, String dbName, String collName, org.bson.BsonDocument filter, org.bson.BsonDocument shardedKeys, org.bson.BsonDocument data)- Specified by:
bulkPatchDocumentsin interfaceDocumentRepository- Parameters:
cs- the client sessiondbName-collName-filter-shardedKeys-data-- Returns:
- the BulkOperationResult
-
deleteDocument
public OperationResult deleteDocument(com.mongodb.client.ClientSession cs, String dbName, String collName, Object documentId, org.bson.BsonDocument filter, org.bson.BsonDocument shardedKeys, String requestEtag, boolean checkEtag)- Specified by:
deleteDocumentin interfaceDocumentRepository- Parameters:
cs- the client sessiondbName-collName-documentId-filter-shardedKeys-requestEtag-checkEtag-- Returns:
- the OperationResult
-
bulkDeleteDocuments
public BulkOperationResult bulkDeleteDocuments(com.mongodb.client.ClientSession cs, String dbName, String collName, org.bson.BsonDocument filter, org.bson.BsonDocument shardedKeys)- Specified by:
bulkDeleteDocumentsin interfaceDocumentRepository- Parameters:
cs- the client sessiondbName-collName-filter-shardedKeys-- Returns:
- the BulkOperationResult
-