Class AbstractMongoDBAction
java.lang.Object
com.kingsrook.qqq.backend.module.mongodb.actions.AbstractMongoDBAction
- Direct Known Subclasses:
MongoDBAggregateAction
,MongoDBCountAction
,MongoDBDeleteAction
,MongoDBInsertAction
,MongoDBQueryAction
,MongoDBUpdateAction
Base class for all mongoDB module actions.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected QRecord
documentToRecord
(QueryInput queryInput, org.bson.Document document) Convert a mongodb document to a QRecord.protected String
Get the name to use for a table in the mongoDB, from the table's backendDetails.protected String
Get the name to use for a field in the mongoDB, from the fieldMetaData.protected int
Getter for queryStatprotected void
logQuery
(String tableName, String actionName, List<org.bson.conversions.Bson> query, Long queryStartTime) protected org.bson.conversions.Bson
makeSearchQueryDocument
(QTableMetaData table, QQueryFilter filter) Convert QQueryFilter to Bson search query document - including security for the table if needed.openClient
(MongoDBBackendMetaData backend, QBackendTransaction transaction) Open a MongoDB Client / session -- re-using the one in the input transaction if it is present.protected org.bson.Document
recordToDocument
(QTableMetaData table, QRecord record) Convert a QRecord to a mongodb document.protected void
setQueryInQueryStat
(org.bson.conversions.Bson query) void
setQueryStat
(QueryStat queryStat) Setter for queryStat
-
Field Details
-
queryStat
-
-
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
Get the name to use for a field in the mongoDB, from the fieldMetaData. That is, field.backendName if set -- else, field.name -
getBackendTableName
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
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
Getter for queryStat -
setQueryStat
Setter for queryStat -
setQueryInQueryStat
protected void setQueryInQueryStat(org.bson.conversions.Bson query) -
logQuery
-