0
Ich habe ein seltsames Problem in spring-data-mongo
.Aggregation.match() funktioniert nicht beim Suchen ID
Query query = new Query();
query.addCriteria(Criteria.where("id").is(id));
List<Hotel> hotels = mongoOperations.find(query, Hotel.class)
geben das korrekte Ergebnis (findById
).
jedoch
MatchOperation match = Aggregation.match(Criteria.where("id").is(id));
Aggregation aggregation = Aggregation.newAggregation(match);
AggregationResults<Hotel> results = mongoOperations.aggregate(aggregation, "hotel", Hotel.class);
wird []
geben jedes Mal.
Gibt es etwas, was ich vermisse?