MongoDB Plugin
  1. MongoDB Plugin
  2. GPMONGODB-229

MongoDB supports uniqueness constraint on compound indexes, but plugin does not

    Details

      Description

      the "compoundIndex" syntax in mapping config currently doesn't have an option for making a compound index have a uniqueness constraint.

      You'd think you could do something like:

      static mapping =

      { compoundIndex a:1, b:2, indexAttributes:[unique:true] }

      But if you do, it simply fails to create the index.

        Activity

        Hide
        Graeme Rocher added a comment -
        Show
        Graeme Rocher added a comment - This plugin provides a solution http://grails.org/plugin/mongodb-compound-index-attributes
        Hide
        Sukrit Khera added a comment -

        The plugin is great , but I think it will be best if this is incorporated as part of the mongodb gorm plugin.

        Show
        Sukrit Khera added a comment - The plugin is great , but I think it will be best if this is incorporated as part of the mongodb gorm plugin.
        Hide
        Eli Israel added a comment -

        Thank you for fixing this. Which version of the plugin should I use to see this fix?

        Show
        Eli Israel added a comment - Thank you for fixing this. Which version of the plugin should I use to see this fix?

          People

          • Assignee:
            Graeme Rocher
            Reporter:
            Eli Israel
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: