After reviewing this page, specifically this query
db.scores.find( { results: { $elemMatch: { $gte: 80, $lt: 85 } } } )
I used the follo
You need to use $elemMatch(projection). Something like below should work.
import static com.mongodb.client.model.Projections.elemMatch; Bson filters = and(eq("userId", userId)); Bson projections = fields(elemMatch(ARRAY_FIELD_NAME, eq("id", id)), excludeId());