Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-16

Unexpected behavior with unique indexes

    • Type: Icon: Task Task
    • Resolution: Done
    • 12_01_17
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      Please see http://gist.github.com/281582 for details.

      In summary, I have a Site model (top level document) that has_many domains (Domain model should be an embedded document). I have created a unique index on a field in the embedded document and it appears to prevent duplicate entries. Unfortunately, a save! encounters a silent failure and still returns true. This can be seen on lines 37 - 38 and on lines 53 - 57 in the gist. Hopefully this makes sense. I can try to explain it better if necessary.

            Assignee:
            Unassigned Unassigned
            Reporter:
            chadrem Chad Remesch
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: