Class MongoPipelineExecutor

java.lang.Object
com.barden.library.database.mongo.pipeline.MongoPipelineExecutor

public final class MongoPipelineExecutor extends Object
Mongo pipeline executor class.
  • Constructor Details

    • MongoPipelineExecutor

      public MongoPipelineExecutor(@Nonnull MongoPipeline pipeline)
      Creates mongo pipeline executor object.
      Parameters:
      pipeline - Mongo pipeline.
  • Method Details

    • getPipeline

      @Nonnull public MongoPipeline getPipeline()
      Gets pipeline.
      Returns:
      Pipeline.
    • getDocument

      @Nonnull public org.bson.Document getDocument()
      Gets document.
      Returns:
      Document.
    • add

      @Nonnull public MongoPipelineExecutor add(@Nonnull Object... keys)
      Adds pipeline action.
      Parameters:
      keys - Keys.
      Returns:
      Mongo pipeline executor builder.
    • setByPath

      @Nonnull public MongoPipelineExecutor setByPath(@Nonnull String path, @Nonnull Object value)
      [SET OPERATION]
      Parameters:
      path - Path.
      value - Value.
      Returns:
      Mongo pipeline executor builder.
    • setByKey

      @Nonnull public MongoPipelineExecutor setByKey(@Nonnull Object key, @Nonnull Object value)
      [SET OPERATION]
      Parameters:
      key - Key.
      value - Value.
      Returns:
      Mongo pipeline executor builder.
    • unsetByPath

      @Nonnull public MongoPipelineExecutor unsetByPath(@Nonnull String path)
      [UNSET OPERATION]
      Parameters:
      path - Path.
      Returns:
      Mongo pipeline executor builder.
    • unsetByKey

      @Nonnull public MongoPipelineExecutor unsetByKey(@Nonnull Object key)
      [UNSET OPERATION]
      Parameters:
      key - Key.
      Returns:
      Mongo pipeline executor builder.
    • increaseByPath

      @Nonnull public MongoPipelineExecutor increaseByPath(@Nonnull String path, @Nonnull Number value)
      [INCREASE OPERATION]
      Parameters:
      path - Path.
      value - Value.
      Returns:
      Mongo pipeline executor builder.
    • increaseByKey

      @Nonnull public MongoPipelineExecutor increaseByKey(@Nonnull Object key, @Nonnull Number value)
      [INCREASE OPERATION]
      Parameters:
      key - Key.
      value - Value.
      Returns:
      Mongo pipeline executor builder.
    • merge

      @Nonnull public MongoPipelineExecutor merge(@Nonnull MongoPipelineExecutor pipeline_executor)
      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

      @Nonnull public String toString()
      Gets mongo pipeline as a string.
      Overrides:
      toString in class Object
      Returns:
      Mongo pipeline string.