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 Summary
Modifier and TypeMethodDescriptiondefault Iterable<org.bson.Document>
apply
(com.mongodb.client.MongoCollection<org.bson.Document> collection) forManyDocuments
(org.bson.conversions.Bson bson) forSingleDocument
(org.bson.conversions.Bson bson) org.bson.conversions.Bson
getQuery()
Get the query to obtain matchingdocuments
.default org.bson.conversions.Bson
getSort()
Get the sort criteria for ordering results.default Iterable<org.bson.Document>
restoreOrder
(Iterable<org.bson.Document> documents) Restore the order of fetched documents.
-
Method Details
-
getQuery
org.bson.conversions.Bson getQuery()Get the query to obtain matchingdocuments
.- 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
Restore the order of fetched documents.- Parameters:
documents
- must not be null.- Returns:
- never null.
-
forSingleDocument
-
forManyDocuments
-
forNoResult
- Returns:
- a
ReferenceLoader.DocumentReferenceQuery
that will not match any documents. - Since:
- 4.2.5
-