I have a Subscription domain object which has a List of ObjectId as one of its properties, say 'subscribed'. I'm on Grails 2.1.2 and MongoDB.
class Subscription {
ObjectId id
List<ObjectId> subscribers = [] as List<ObjectId>
static mapWith = "mongo"
}
I'm looking for something like this
def c = Subscription.withCriteria {
contains("subscribers", specificId)
}
Is there a way to do this?
Note: I'm aware of this very same question but provided answer to that question doesn't work for a property which is of type List of ObjectId.