Package dev.morphia.aggregation.stages
Class Densify
- java.lang.Object
-
- dev.morphia.aggregation.stages.Stage
-
- dev.morphia.aggregation.stages.Densify
-
public class Densify extends Stage
Creates new documents in a sequence of documents where certain values in a field are missing.You can use $densify to:
- Fill gaps in time series data.
- Add missing values between groups of data.
- Populate your data with a specified range of values.
- Since:
- 2.3
- Since server release
- 5.1
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Densify.Range
static class
Densify.RangeType
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Densify
densify(String field, Densify.Range range)
Creates new documents in a sequence of documents where certain values in a field are missing.String
field()
List<String>
partitionByFields()
Densify
partitionByFields(String... partitionByFields)
The set of fields to act as the compound key to group the documents.Densify.Range
range()
-
Methods inherited from class dev.morphia.aggregation.stages.Stage
aggregation, stageName
-
-
-
-
Method Detail
-
densify
public static Densify densify(String field, Densify.Range range)
Creates new documents in a sequence of documents where certain values in a field are missing.You can use $densify to:
- Fill gaps in time series data.
- Add missing values between groups of data.
- Populate your data with a specified range of values.
- Parameters:
field
- The field to densify. The values of the specified field must either be all numeric values or all dates.range
- specifies how the data is densified.- Returns:
- the new stage
- Since:
- 2.3
- MongoDB documentation
- Aggregration Expression: $densify
- Since server release
- 5.1
-
field
@MorphiaInternal public String field()
- Returns:
- this
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
partitionByFields
public Densify partitionByFields(String... partitionByFields)
The set of fields to act as the compound key to group the documents. In the $densify stage, each group of documents is known as a partition.If you omit this field, $densify uses one partition for the entire collection.
- Parameters:
partitionByFields
- the fields to partition by- Returns:
- this
-
partitionByFields
@MorphiaInternal public List<String> partitionByFields()
- Returns:
- this
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
range
@MorphiaInternal public Densify.Range range()
- Returns:
- this
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
-