Update should use shard key

XMLWordPrintableJSON

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

      Let's have a collection sharded by key

      {answerer : 1}

      Then let's find an answer by its primary key:
      answer = Answer.find('4c91524c9b3b494747000019')

      Try to update
      answer.is_open = 1
      answer.save

      Save sends this
      Answer.collection.update({:_id => answer.id},
      {"$set" => {:opn => 1,
      :updated_at => Time.now}})

      This operation silently fails on Mongo side and Mongoid doesn't capture this.

      Should either fail as well, or send shard key along
      Answer.collection.update({:_id => answer.id, :answerer => @viewer.id},
      {"$set" => {:is_open => 1,
      :updated_at => Time.now}})

      We could be able to specify shard key in the model.

            Assignee:
            Unassigned
            Reporter:
            Sergei Tulentsev
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: