Interface DensifyOptions

All Superinterfaces:
Bson

@Evolving public interface DensifyOptions extends Bson
Represents optional fields of the $densify pipeline stage of an aggregation pipeline.
Since:
4.7
See Also:
Since server release
5.1
  • Method Details

    • partitionByFields

      default DensifyOptions partitionByFields(@Nullable String... fields)
      Creates a new DensifyOptions with the specified fields to partition by.
      Parameters:
      fields - The fields to partition by. If no fields are specified, then the whole sequence is considered to be a single partition.
      Returns:
      A new DensifyOptions.
      MongoDB documentation
      Dot notation
    • partitionByFields

      DensifyOptions partitionByFields(Iterable<String> fields)
      Creates a new DensifyOptions with the specified fields to partition by.
      Parameters:
      fields - The fields to partition by. If no fields are specified, then the whole sequence is considered to be a single partition.
      Returns:
      A new DensifyOptions.
      MongoDB documentation
      Dot notation
    • option

      DensifyOptions option(String name, Object value)
      Creates a new DensifyOptions with the specified option in situations when there is no builder method that better satisfies your needs. This method cannot be used to validate the syntax.

      Example
      The following code creates two functionally equivalent DensifyOptions objects, though they may not be equal.

      
        DensifyOptions options1 = DensifyOptions.densifyOptions()
                .partitionByFields("fieldName");
        DensifyOptions options2 = DensifyOptions.densifyOptions()
                .option("partitionByFields", Collections.singleton("fieldName"));
       
      Parameters:
      name - The option name.
      value - The option value.
      Returns:
      A new DensifyOptions.
    • densifyOptions

      static DensifyOptions densifyOptions()
      Returns DensifyOptions that represents server defaults.
      Returns:
      DensifyOptions that represents server defaults.