Class MongoAction

java.lang.Object
org.springframework.data.mongodb.core.MongoAction

public class MongoAction extends Object
Represents an action taken against the collection. Used by WriteConcernResolver to determine a custom WriteConcern based on this information.
  • INSERT, SAVE have null query
  • REMOVE has null document
  • INSERT_LIST has null entityType, document, and query
Author:
Mark Pollack, Oliver Gierke, Christoph Strobl
  • Constructor Details

    • MongoAction

      public MongoAction(@Nullable com.mongodb.WriteConcern defaultWriteConcern, MongoActionOperation mongoActionOperation, String collectionName, @Nullable Class<?> entityType, @Nullable org.bson.Document document, @Nullable org.bson.Document query)
      Create an instance of a MongoAction.
      Parameters:
      defaultWriteConcern - the default write concern. Can be null.
      mongoActionOperation - action being taken against the collection. Must not be null.
      collectionName - the collection name, must not be null or empty.
      entityType - the POJO that is being operated against. Can be null.
      document - the converted Document from the POJO or Spring Update object. Can be null.
      query - the converted Document from the Spring Query object. Can be null.
  • Method Details

    • getCollectionName

      public String getCollectionName()
    • getDefaultWriteConcern

      @Nullable public com.mongodb.WriteConcern getDefaultWriteConcern()
    • getEntityType

      @Nullable public Class<?> getEntityType()
    • getMongoActionOperation

      @Nullable public MongoActionOperation getMongoActionOperation()
    • getQuery

      @Nullable public org.bson.Document getQuery()
    • getDocument

      @Nullable public org.bson.Document getDocument()