You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The @MongoId annotation is not being taken into account for aggregate queries like it is for find queries. This causes incorrect results for the aggregation match query because it's improperly looking for an ObjectId instead of a plain String; i.e., it's improperly wrapping the value in an { "$oid" : "<ObjectId bytes>"}.
Thanks for reporting and long silence. Good catch - this seems to have happened by a 2nd mapping pass done in MongoTemplate which then converted the _id from String to ObjectId.
A snapshot build for 4.1.0-GH-4043-SNAPSHOT should be available soon if you want to give it a try.
The
@MongoId
annotation is not being taken into account foraggregate
queries like it is forfind
queries. This causes incorrect results for the aggregation match query because it's improperly looking for an ObjectId instead of a plain String; i.e., it's improperly wrapping the value in an{ "$oid" : "<ObjectId bytes>"}
.Using:
Example code:
Generated queries (
logging.level.org.springframework.data.mongodb.core: DEBUG
)Actual:
{ "_id" : { "$oid" : "4ee921aca44fd11b3254e001"}}
Expected:
{ "_id" : "4ee921aca44fd11b3254e001"}
:The text was updated successfully, but these errors were encountered: