Class Facet

java.lang.Object
com.mongodb.client.model.Facet

public class Facet extends Object
Defines a Facet for use in $facet pipeline stages.
Since:
3.4
MongoDB documentation
$facet
Since server release
3.4
  • Constructor Details

    • Facet

      public Facet(String name, List<? extends Bson> pipeline)
      Parameters:
      name - the name of this facet
      pipeline - the facet definition pipeline
    • Facet

      public Facet(String name, Bson... pipeline)
      Parameters:
      name - the name of this facet
      pipeline - the facet definition pipeline
  • Method Details

    • getName

      public String getName()
      Returns:
      the facet name
    • getPipeline

      public List<? extends Bson> getPipeline()
      Returns:
      the pipeline definition
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object