Class Group


  • public class Group
    extends Stage
    Groups input documents by the specified _id expression and for each distinct grouping, outputs a document.
    • Constructor Detail

      • Group

        protected Group()
    • Method Detail

      • group

        public static Group group​(Group.GroupId id)
        Creates a group stage with an ID definition
        Parameters:
        id - the group ID
        Returns:
        the new stage
        Since:
        2.2
      • group

        public static Group group()
        Creates a group stage with no ID definition
        Returns:
        the new stage
        Since:
        2.2
      • id

        public static Group.GroupId id()
        Creates an unnamed group ID
        Returns:
        the new groupID
      • id

        public static Group.GroupId id​(String name)
        Creates a named group ID
        Parameters:
        name - the id name
        Returns:
        the new groupID
      • id

        public static Group.GroupId id​(Expression name)
        Creates a named group ID
        Parameters:
        name - the id name
        Returns:
        the new groupID
      • of

        @Deprecated(forRemoval=true)
        public static Group of​(Group.GroupId id)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Creates a group stage with an ID definition
        Parameters:
        id - the group ID
        Returns:
        the new stage
      • of

        @Deprecated(forRemoval=true)
        public static Group of()
        Deprecated, for removal: This API element is subject to removal in a future version.
        user group()
        Creates a group stage with no ID definition
        Returns:
        the new stage
      • field

        public Group field​(String name,
                           Expression expression)
        Adds a named field to the group with an expression giving the value.
        Parameters:
        name - the name of the field
        expression - the expression giving the value
        Returns:
        this
      • getFields

        @Nullable
        public Fields<Group> getFields()
        Returns:
        the fields
        Developer note.
        This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
      • getId

        @Nullable
        public Group.GroupId getId()
        Returns:
        the ID
        Developer note.
        This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.