Class 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 Detail

      • BucketOptions

        public BucketOptions()
    • Method Detail

      • 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
      • 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
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object