-
Notifications
You must be signed in to change notification settings - Fork 199
Closed
Description
Original Reporter: alexduan
Environment: Grails 1.3.6, MongoDB-1.0.M4
Version: Not Specified
Migrated From: http://jira.grails.org/browse/GPMONGODB-12
For a class Email:
{code}
class Email {
String address
}
{code}
If I try to embed it into my Person:
{code}
class Person {
Email email
static embedded = ['email']
}
{code}
This works fine. When I try to embed a list of Emails with either:
{code}
class Person {
static hasMany = [emails:Email]
static embedded = ['emails']
}
{code}
or:
{code}
class Person {
List emails
static hasMany = [emails:Email]
static embedded = ['emails']
}
{code}
The document that is stored in Mongo looks like:
{code}
{"_id" : NumberLong(1), "emails" : [ NumberLong(1) ] }
{code}