Class AbstractMongoDBAction

java.lang.Object
com.kingsrook.qqq.backend.module.mongodb.actions.AbstractMongoDBAction
Direct Known Subclasses:
MongoDBAggregateAction, MongoDBCountAction, MongoDBDeleteAction, MongoDBInsertAction, MongoDBQueryAction, MongoDBUpdateAction

public class AbstractMongoDBAction extends Object
Base class for all mongoDB module actions.
  • Field Details

  • Constructor Details

    • AbstractMongoDBAction

      public AbstractMongoDBAction()
  • Method Details

    • openClient

      public MongoClientContainer openClient(MongoDBBackendMetaData backend, QBackendTransaction transaction)
      Open a MongoDB Client / session -- re-using the one in the input transaction if it is present.
    • getFieldBackendName

      protected String getFieldBackendName(QFieldMetaData field)
      Get the name to use for a field in the mongoDB, from the fieldMetaData. That is, field.backendName if set -- else, field.name
    • getBackendTableName

      protected String getBackendTableName(QTableMetaData table)
      Get the name to use for a table in the mongoDB, from the table's backendDetails. else, the table's name.
    • getPageSize

      protected int getPageSize()
    • documentToRecord

      protected QRecord documentToRecord(QueryInput queryInput, org.bson.Document document)
      Convert a mongodb document to a QRecord.
    • recordToDocument

      protected org.bson.Document recordToDocument(QTableMetaData table, QRecord record) throws QException
      Convert a QRecord to a mongodb document.
      Throws:
      QException
    • makeSearchQueryDocument

      protected org.bson.conversions.Bson makeSearchQueryDocument(QTableMetaData table, QQueryFilter filter) throws QException
      Convert QQueryFilter to Bson search query document - including security for the table if needed.
      Throws:
      QException
    • getQueryStat

      public QueryStat getQueryStat()
      Getter for queryStat
    • setQueryStat

      public void setQueryStat(QueryStat queryStat)
      Setter for queryStat
    • setQueryInQueryStat

      protected void setQueryInQueryStat(org.bson.conversions.Bson query)
    • logQuery

      protected void logQuery(String tableName, String actionName, List<org.bson.conversions.Bson> query, Long queryStartTime)