Skip to content

String @id field is not mapped to ObjectId when using QueryDSL ".id" path [DATAMONGO-467] #1404

@spring-projects-issues

Description

@spring-projects-issues

Rob Shepherd opened DATAMONGO-467 and commented

Using this entity (@Document) definition with a String as the declared ID:

User.class
...
@Id String id;

and the following query

QUser.id.eq("4f43b6a384aea4e77d403709")

Always returns null for a repository find. Looking at the mongoDb query log (mongod -v) it appears that the spring-data-mongodb/QueryDSL layers are not translating the String 4f43b6a384aea4e77d403709 to ObjectId("4f43b6a384aea4e77d403709") as one would normally do in the mongo shell


Affects: 1.0.2, 1.1 M1

Reference URL: http://forum.springsource.org/showthread.php?114694-MongoDB-Spring-Data-Document-Repository-and-Querydsl-with-Id&p=416843#post416843

Attachments:

Referenced from: commits ba81f21, ee3c1bc

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions