grails - How to map Set<String>? -
my grails domain class backed mongodb , tags property:
set<string> tags
i'm trying make searchable , can queried "tags:something,somethingelse".
let me quote bit adapted example understanding mongodb querying in grails , gorm
for collections of non-objects such list, inlist function in grails can check specific existence of item.
yourdomainclass.findall { inlist('tags', 'something', 'somethingelse') }
this produces mongodb query { tags: { $in: [ "something", "somethingelse" ] } } correlating $in operator.
so believe it's matter of proper query gorm.
Comments
Post a Comment