Class DocumentDAO

java.lang.Object
org.restheart.mongodb.db.DocumentDAO
All Implemented Interfaces:
DocumentRepository

public class DocumentDAO extends Object implements DocumentRepository
Author:
Andrea Di Cesare <andrea@softinstigate.com>
  • 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: DocumentRepository
      returns the ETag of the document
      Specified by:
      getDocumentEtag in interface DocumentRepository
      Parameters:
      cs - the client session
      dbName -
      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:
      writeDocument in interface DocumentRepository
      Parameters:
      cs - the client session
      dbName -
      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:
      writeDocumentPost in interface DocumentRepository
      Parameters:
      cs - the client session
      dbName -
      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:
      bulkPostDocuments in interface DocumentRepository
      Parameters:
      cs - the client session
      dbName -
      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:
      bulkPatchDocuments in interface DocumentRepository
      Parameters:
      cs - the client session
      dbName -
      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:
      deleteDocument in interface DocumentRepository
      Parameters:
      cs - the client session
      dbName -
      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:
      bulkDeleteDocuments in interface DocumentRepository
      Parameters:
      cs - the client session
      dbName -
      collName -
      filter -
      shardedKeys -
      Returns:
      the BulkOperationResult