Grails 2.1.1, mongodb 1.0.0.GA.
I have two domain classes:
class Person {
String firstName
String lastName
Address address
static embedded = ['address']
}
class Address {
String street
String city
String zip
}
I want to find all persons living in Redmond. I expect that something like:
Person.createCriteria().list() {
eq 'address.city', 'Redmond'
}
would do the job but it does not. I know it is a 1st class citizen query for Mongo itself.
Is that not supported yet in mongodb 1.0.0.GA or I'm missing something obvious? I'm confused mostly because embedded documents is a bread and butter for mongo and not supporting such an obvious use case renders the whole plugin unusable.
i tested your example (copy-pasted your code) and it worked fine without any errors.
Env: Grails 2.0.4, mongodb 1.0.0.GA