mysema/querydsl — Issue #113: Support MongoDB DbRef fields
Author: rocketraman
Created: 2012-03-08 23:38:49+00:00
State: open

MongoDB supports DbRef fields when one document needs to refer to another in a standard way -- see http://www.mongodb.org/display/DOCS/Database+References.

It would be really excellent if QueryDSL could support doing queries where fields that represented DbRefs were automatically traversed during a query. For example (using the Spring Data Mongodb annotations):

```
@Document
Obj1 {
@DbRef Obj2 obj2Ref;
}

@Document
Obj2 {
String foo;
}
```

then one could do the following query:

```
query
.where(QObj1.obj2Ref.foo.eq("Bob"))
.list()
```