Class BucketOptions

java.lang.Object
com.mongodb.client.model.BucketOptions

public class BucketOptions extends Object
The options for a $bucket aggregation pipeline stage
Since:
3.4
MongoDB documentation
$bucket
Since server release
3.4
  • Constructor Details

    • BucketOptions

      public BucketOptions()
  • Method Details

    • defaultBucket

      public BucketOptions defaultBucket(@Nullable Object name)
      The name of the default bucket for values outside the defined buckets
      Parameters:
      name - the bucket value
      Returns:
      this
    • getDefaultBucket

      @Nullable public Object getDefaultBucket()
      Returns:
      the default bucket value
    • getOutput

      @Nullable public List<BsonField> getOutput()
      Returns:
      the output document definition
    • output

      public BucketOptions output(BsonField... output)
      The definition of the output document in each bucket
      Parameters:
      output - the output document definition
      Returns:
      this
    • output

      public BucketOptions output(List<BsonField> output)
      The definition of the output document in each bucket
      Parameters:
      output - the output document definition
      Returns:
      this
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object