Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-635

find_and_modify does not return lastErrorObject

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.9.2
    • Affects Version/s: 1.9.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      Mac OSX, Linux

      http://docs.mongodb.org/manual/reference/command/findAndModify/
      The findAndModify command in mongo returns information in "lastErrorObject", such as "updatedExisting" and "upserted". It is useful information to have if it is to be determined what action the last findAndModify command took.
      However, the ruby driver does not return the lastErrorObject part of the response.
      https://github.com/mongodb/mongo-ruby-driver/blob/master/lib/mongo/collection.rb
      http://api.mongodb.org/ruby/current/Mongo/Collection.html
      Currently, is there a way for a ruby client to obtain this information?
      The ruby implementation of find_and_modify should return the complete response, and not just the "value" part of it.

            Assignee:
            brandon.black@10gen.com Brandon Black
            Reporter:
            saraogi@adobe.com Mayank Saraogi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: