Package com.mongodb.client.model.densify
Interface DensifyOptions
- All Superinterfaces:
Bson
Represents optional fields of the
$densify pipeline stage of an aggregation pipeline.- Since:
- 4.7
- See Also:
- Since server release
- 5.1
-
Field Summary
Fields inherited from interface org.bson.conversions.Bson
DEFAULT_CODEC_REGISTRY -
Method Summary
Modifier and TypeMethodDescriptionstatic DensifyOptionsReturnsDensifyOptionsthat represents server defaults.Creates a newDensifyOptionswith the specified option in situations when there is no builder method that better satisfies your needs.partitionByFields(Iterable<String> fields) Creates a newDensifyOptionswith the specifiedfieldsto partition by.default DensifyOptionspartitionByFields(String... fields) Creates a newDensifyOptionswith the specifiedfieldsto partition by.Methods inherited from interface org.bson.conversions.Bson
toBsonDocument, toBsonDocument
-
Method Details
-
partitionByFields
Creates a newDensifyOptionswith the specifiedfieldsto 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
Creates a newDensifyOptionswith the specifiedfieldsto 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
Creates a newDensifyOptionswith 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 equivalentDensifyOptionsobjects, 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
ReturnsDensifyOptionsthat represents server defaults.- Returns:
DensifyOptionsthat represents server defaults.
-