Hi.
I am quite new to MongoDB and MongoJack.
I have the follwing collection (test example)
pdf [
-id : "92837ALKJ2397"
players: [
playerId: "293829378"
items = [
//Here is some stuff
]
]
]
I would like to create a query that uses the pdf id and playerId to get the items
How can I do this?
Right now I do this
pbfCollection.findOneById(pbfId);
PBF pbf = pbfCollection.findOneById(pbfId);
List<Items> items = pbf.getPlayers().stream()
.filter(p -> p.getPlayerId().equals(playerId))
.findFirst()
.orElseThrow(PlayerAction::cannotFindItem)
.getItems()
I would like to create a simple query that takes pdfId and playerId as parameter and retrieves my Items list.