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

Changes between 2.1.2 with string/integer keys for $set

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 2.2.0, bson-4.0.0
    • Affects Version/s: 2.2.0
    • Component/s: None
    • None
    • Environment:
      Mac OSX running MongoDB 3.0.5

      This code works on mongo-ruby-driver 2.1.2 but fails on 2.2.0-rc0:

      <code>
      MyModel.class.collection.find({:_id => model.id}).update_one(:$set => {"foo" => {1 => "2"}})
      <code>

      error:

      <code>
      ongo::Error::SocketError: end of file reached
      from /usr/local/lib/ruby/gems/2.2.0/bundler/gems/mongo-ruby-driver-4119e1fb5cf7/lib/mongo/socket.rb:195:in `rescue in handle_errors'
      from /usr/local/lib/ruby/gems/2.2.0/bundler/gems/mongo-ruby-driver-4119e1fb5cf7/lib/mongo/socket.rb:190:in `handle_errors'
      from /usr/local/lib/ruby/gems/2.2.0/bundler/gems/mongo-ruby-driver-4119e1fb5cf7/lib/mongo/socket.rb:122:in `read'
      from /usr/local/lib/ruby/gems/2.2.0/bundler/gems/mongo-ruby-driver-4119e1fb5cf7/lib/mongo/protocol/message.rb:106:in `deserialize'
      from /usr/local/lib/ruby/gems/2.2.0/bundler/gems/mongo-ruby-driver-4119e1fb5cf7/lib/mongo/server/connectable.rb:107:in `block in read'
      from /usr/local/lib/ruby/gems/2.2.0/bundler/gems/mongo-ruby-driver-4119e1fb5cf7/lib/mongo/server/connectable.rb:91:in `ensure_connected'
      from /usr/local/lib/ruby/gems/2.2.0/bundler/gems/mongo-ruby-driver-4119e1fb5cf7/lib/mongo/server/connectable.rb:106:in `read'
      from /usr/local/lib/ruby/gems/2.2.0/bundler/gems/mongo-ruby-driver-4119e1fb5cf7/lib/mongo/server/connection.rb:190:in `deliver'
      from /usr/local/lib/ruby/gems/2.2.0/bundler/gems/mongo-ruby-driver-4119e1fb5cf7/lib/mongo/server/connection.rb:135:in `block in dispatch'
      from /usr/local/lib/ruby/gems/2.2.0/bundler/gems/mongo-ruby-driver-4119e1fb5cf7/lib/mongo/monitoring/publishable.rb:47:in `publish_command'
      from /usr/local/lib/ruby/gems/2.2.0/bundler/gems/mongo-ruby-driver-4119e1fb5cf7/lib/mongo/server/connection.rb:134:in `dispatch'
      from /usr/local/lib/ruby/gems/2.2.0/bundler/gems/mongo-ruby-driver-4119e1fb5cf7/lib/mongo/operation/write/command/writable.rb:38:in `block in execute'
      from /usr/local/lib/ruby/gems/2.2.0/bundler/gems/mongo-ruby-driver-4119e1fb5cf7/lib/mongo/server/connection_pool.rb:111:in `with_connection'
      from /usr/local/lib/ruby/gems/2.2.0/bundler/gems/mongo-ruby-driver-4119e1fb5cf7/lib/mongo/server/context.rb:63:in `with_connection'
      from /usr/local/lib/ruby/gems/2.2.0/bundler/gems/mongo-ruby-driver-4119e1fb5cf7/lib/mongo/operation/write/command/writable.rb:37:in `execute'
      from /usr/local/lib/ruby/gems/2.2.0/bundler/gems/mongo-ruby-driver-4119e1fb5cf7/lib/mongo/operation/write/write_command_enabled.rb:48:in `execute_write_command'
      from /usr/local/lib/ruby/gems/2.2.0/bundler/gems/mongo-ruby-driver-4119e1fb5cf7/lib/mongo/operation/write/write_command_enabled.rb:38:in `execute'
      from /usr/local/lib/ruby/gems/2.2.0/bundler/gems/mongo-ruby-driver-4119e1fb5cf7/lib/mongo/collection/view/writable.rb:209:in `block in update'
      from /usr/local/lib/ruby/gems/2.2.0/bundler/gems/mongo-ruby-driver-4119e1fb5cf7/lib/mongo/retryable.rb:89:in `call'
      from /usr/local/lib/ruby/gems/2.2.0/bundler/gems/mongo-ruby-driver-4119e1fb5cf7/lib/mongo/retryable.rb:89:in `write_with_retry'
      from /usr/local/lib/ruby/gems/2.2.0/bundler/gems/mongo-ruby-driver-4119e1fb5cf7/lib/mongo/collection/view/writable.rb:199:in `update'
      from /usr/local/lib/ruby/gems/2.2.0/bundler/gems/mongo-ruby-driver-4119e1fb5cf7/lib/mongo/collection/view/writable.rb:182:in `update_one'
      from /usr/local/lib/ruby/gems/2.2.0/bundler/gems/mongoid-775da327de64/lib/mongoid/query_cache.rb:168:in `update_one_with_clear_cache'
      <code>

      Isn't bothering us, this was just in one of our specs. I don't know where the changelog is for this driver, so not sure if it's expected.

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            jonhyman Jon Hyman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: