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 DensifyOptions
ReturnsDensifyOptions
that represents server defaults.Creates a newDensifyOptions
with the specified option in situations when there is no builder method that better satisfies your needs.partitionByFields
(Iterable<String> fields) Creates a newDensifyOptions
with the specifiedfields
to partition by.default DensifyOptions
partitionByFields
(String... fields) Creates a newDensifyOptions
with the specifiedfields
to partition by.Methods inherited from interface org.bson.conversions.Bson
toBsonDocument, toBsonDocument
-
Method Details
-
partitionByFields
Creates a newDensifyOptions
with the specifiedfields
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
Creates a newDensifyOptions
with the specifiedfields
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
Creates a newDensifyOptions
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 equivalentDensifyOptions
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
ReturnsDensifyOptions
that represents server defaults.- Returns:
DensifyOptions
that represents server defaults.
-