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

Fields limit and save

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

      The fields ​​are saved with the default values if you make a query with fields limit and save the record.

      Record in the database:

      #<Record _id: 4f1ff7e705d04c0e49000019, _type: nil, uid: BSON::ObjectId('4efe63b405d04c07f600000d'), title: "Title", public: true>
      
      @record= Record.where(public: true).only(:_id, :public).find('4f1ff7e705d04c0e49000019')
      @record.save(:validate => false)
      

      Get it

      #<Record _id: 4f1ff7e705d04c0e49000019, _type: nil, uid: nil, title: nil, public: true>
      

            Assignee:
            durran Durran Jordan
            Reporter:
            vshkurin vshkurin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: