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

persistence issues w/ updating composite key fields

    • Type: Icon: Task Task
    • Resolution: Done
    • 2.3.2
    • Affects Version/s: None
    • Component/s: None
    • None

      i was noticing strange problems with updating fields being used as composite keys. the queries seemed to be running correctly, however when i started to investigate their actual persistence to the DB, i got another story.

      i documented a simple example of the behavior here... http://pastie.org/1963766

      basically updating a field involved with being a composite key, would return true when updated, and even the id being modified properly... but apparently only in memory. When hitting the DB, the object still has pre-update data. It even prevents other non-key attributes included in the query to not be updated.

      If this is the desired behavior, mongoid should throw an error instead of returning true for an unpersisted update... but isn't updating an id possible with Mongo?

            Assignee:
            Unassigned Unassigned
            Reporter:
            brewster1134 Ryan Brewster
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: