In working with Grails and MongoDB, I found myself building out some data type documentation I wasn’t able to find. For your coding pleasure, please find…
Groovy Type | Mongo Type |
Integer | Int32 |
Double | Double |
Long | Int64 |
Float | String |
Short | Int32 |
Grails is great, but the documentation is limited and the dates/versions of the references matter a lot (it seems Grails has been through many versions and many recommended approaches, not all of which are backwards-compatible). The above mapping is for Grails 2.4.4 and the mongodb plugin 3.0.2, atop MongoDB 2.6.3.