You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An UnsupportedOperationException is thrown when using a SingletonList in an '$in' query when using the Grails Mongo Gorm plugin. Grails has this odd behavior where you get a SingletonList when converting an http parameter to a list (params.list('userIds')) on a one item parameter. In the cases where you have multiple items in the parameter you get an ArrayList, which works fine with gmongo. The work around is to use a mutable list or cast the value to a string array.
Here is an example of a Mongo Gorm call that would fail if the collection is a SingletonList
User.collection.find([_id: ['$in': singletonListOfIds]])
An UnsupportedOperationException is thrown when using a SingletonList in an '$in' query when using the Grails Mongo Gorm plugin. Grails has this odd behavior where you get a SingletonList when converting an http parameter to a list (params.list('userIds')) on a one item parameter. In the cases where you have multiple items in the parameter you get an ArrayList, which works fine with gmongo. The work around is to use a mutable list or cast the value to a string array.
Here is an example of a Mongo Gorm call that would fail if the collection is a SingletonList
User.collection.find([_id: ['$in': singletonListOfIds]])
The text was updated successfully, but these errors were encountered: