Class MongoPipelineExecutor
java.lang.Object
com.barden.library.database.mongo.pipeline.MongoPipelineExecutor
Mongo pipeline executor class.
-
Constructor Summary
ConstructorsConstructorDescriptionMongoPipelineExecutor(MongoPipeline pipeline) Creates mongo pipeline executor object. -
Method Summary
Modifier and TypeMethodDescriptionAdds pipeline action.voidexecute()Executes database pipeline.voidexecute(boolean async) Executes mongo pipeline.org.bson.DocumentGets document.Gets pipeline.org.bson.Documentincrease()Gets increase operation.increaseByKey(Object key, Number value) [INCREASE OPERATION]increaseByPath(String path, Number value) [INCREASE OPERATION]merge(MongoPipelineExecutor pipeline_executor) Merges pipeline.org.bson.Documentset()Gets set operation.[SET OPERATION][SET OPERATION]toString()Gets mongo pipeline as a string.org.bson.Documentunset()Gets unset operation.unsetByKey(Object key) [UNSET OPERATION]unsetByPath(String path) [UNSET OPERATION]
-
Constructor Details
-
MongoPipelineExecutor
Creates mongo pipeline executor object.- Parameters:
pipeline- Mongo pipeline.
-
-
Method Details
-
getPipeline
Gets pipeline.- Returns:
- Pipeline.
-
getDocument
@Nonnull public org.bson.Document getDocument()Gets document.- Returns:
- Document.
-
add
Adds pipeline action.- Parameters:
keys- Keys.- Returns:
- Mongo pipeline executor builder.
-
setByPath
[SET OPERATION]- Parameters:
path- Path.value- Value.- Returns:
- Mongo pipeline executor builder.
-
setByKey
[SET OPERATION]- Parameters:
key- Key.value- Value.- Returns:
- Mongo pipeline executor builder.
-
unsetByPath
[UNSET OPERATION]- Parameters:
path- Path.- Returns:
- Mongo pipeline executor builder.
-
unsetByKey
[UNSET OPERATION]- Parameters:
key- Key.- Returns:
- Mongo pipeline executor builder.
-
increaseByPath
[INCREASE OPERATION]- Parameters:
path- Path.value- Value.- Returns:
- Mongo pipeline executor builder.
-
increaseByKey
[INCREASE OPERATION]- Parameters:
key- Key.value- Value.- Returns:
- Mongo pipeline executor builder.
-
merge
Merges pipeline.- Parameters:
pipeline_executor- Pipeline executor.- Returns:
- Mongo pipeline document.
-
execute
public void execute(boolean async) Executes mongo pipeline.- Parameters:
async- Async status.
-
execute
public void execute()Executes database pipeline. -
set
@Nonnull public org.bson.Document set()Gets set operation.- Returns:
- Set operation.
-
unset
@Nonnull public org.bson.Document unset()Gets unset operation.- Returns:
- Unset operation.
-
increase
@Nonnull public org.bson.Document increase()Gets increase operation.- Returns:
- Increase operation.
-
toString
Gets mongo pipeline as a string.
-