Class UnwindOptions



  • public final class UnwindOptions
    extends java.lang.Object
    The options for an unwind aggregation pipeline stage
    Since:
    3.2
    MongoDB documentation
    $unwind
    Since server release
    3.2
    • Constructor Summary

      Constructors 
      Constructor Description
      UnwindOptions​()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getIncludeArrayIndex​()
      Gets the includeArrayIndex field if set or null
      UnwindOptions includeArrayIndex​(java.lang.String arrayIndexFieldName)
      Sets the field to be used to store the array index of the unwound item
      java.lang.Boolean isPreserveNullAndEmptyArrays​()
      If true the unwind stage will include documents that have null values or empty arrays
      UnwindOptions preserveNullAndEmptyArrays​(java.lang.Boolean preserveNullAndEmptyArrays)
      Sets true if the unwind stage should include documents that have null values or empty arrays
      java.lang.String toString​()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • UnwindOptions

        public UnwindOptions​()
    • Method Detail

      • isPreserveNullAndEmptyArrays

        @Nullable
        public java.lang.Boolean isPreserveNullAndEmptyArrays​()
        If true the unwind stage will include documents that have null values or empty arrays
        Returns:
        the preserve null values and empty arrays value or null
      • preserveNullAndEmptyArrays

        public UnwindOptions preserveNullAndEmptyArrays​(@Nullable
                                                        java.lang.Boolean preserveNullAndEmptyArrays)
        Sets true if the unwind stage should include documents that have null values or empty arrays
        Parameters:
        preserveNullAndEmptyArrays - flag depicting if the unwind stage should include documents that have null values or empty arrays
        Returns:
        this
      • getIncludeArrayIndex

        @Nullable
        public java.lang.String getIncludeArrayIndex​()
        Gets the includeArrayIndex field if set or null
        Returns:
        the includeArrayIndex field if set or null
      • includeArrayIndex

        public UnwindOptions includeArrayIndex​(@Nullable
                                               java.lang.String arrayIndexFieldName)
        Sets the field to be used to store the array index of the unwound item
        Parameters:
        arrayIndexFieldName - the field to be used to store the array index of the unwound item
        Returns:
        this
      • toString

        public java.lang.String toString​()
        Overrides:
        toString in class java.lang.Object