Interface ReferenceLoader.DocumentReferenceQuery

All Known Implementing Classes:
ReferenceLoader.NoResultsFilter
Enclosing interface:
ReferenceLoader

public static interface ReferenceLoader.DocumentReferenceQuery
The ReferenceLoader.DocumentReferenceQuery defines the criteria by which documents should be matched applying potentially given order criteria.
  • Method Details

    • getQuery

      org.bson.conversions.Bson getQuery()
      Get the query to obtain matching documents.
      Returns:
      never null.
    • getSort

      default org.bson.conversions.Bson getSort()
      Get the sort criteria for ordering results.
      Returns:
      an empty Document by default. Never null.
    • apply

      default Iterable<org.bson.Document> apply(com.mongodb.client.MongoCollection<org.bson.Document> collection)
    • restoreOrder

      default Iterable<org.bson.Document> restoreOrder(Iterable<org.bson.Document> documents)
      Restore the order of fetched documents.
      Parameters:
      documents - must not be null.
      Returns:
      never null.
    • forSingleDocument

      static ReferenceLoader.DocumentReferenceQuery forSingleDocument(org.bson.conversions.Bson bson)
    • forManyDocuments

      static ReferenceLoader.DocumentReferenceQuery forManyDocuments(org.bson.conversions.Bson bson)
    • forNoResult

      Returns:
      a ReferenceLoader.DocumentReferenceQuery that will not match any documents.
      Since:
      4.2.5