Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-16260

Some commands no longer accept values of the Symbol BSON type

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.8.0-rc5
    • Affects Version/s: 2.8.0-rc0
    • Component/s: Internal Code
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Hide

      For reference when reading the following: a Ruby symbol is represented in the form :symbol and is serialized to the BSON Symbol type.
      Using the most recent Ruby driver (1.12.0.rc0), with MongoDB server version 2.6:

      client = MongoClient.new
      db = client['test']
      db.create_collection(:foo)
      db.drop_collection(:foo)
      => true
      

      This is what mongosniff shows:

      127.0.0.1:56381  -->> 127.0.0.1:27017 admin.$cmd  58 bytes  id:e	14
      	query: { drop: "foo" }  ntoreturn: -1 ntoskip: 0
      127.0.0.1:27017  <<--  127.0.0.1:56381   88 bytes  id:f	15 - 14
      	reply n:1 cursorId: 0
      	{ ns: "admin.foo", nIndexesWas: 1, ok: 1.0 }
       

      With MongoDB nightly Nov-18-2014 and the most recent Ruby driver (1.12.0.rc0):

      client = MongoClient.new
      db = client['test']
      db.create_collection(:foo)
      db.drop_collection(:foo)
      => false
      

      And this is the mongosniff output

      127.0.0.1:56381  -->> 127.0.0.1:27017 admin.$cmd  58 bytes  id:13	19
      	query: { drop: "foo" }  ntoreturn: -1 ntoskip: 0
      127.0.0.1:27017  <<--  127.0.0.1:56381   94 bytes  id:14	20 - 19
      	reply n:1 cursorId: 0
      	{ ok: 0.0, errmsg: "no collection name specified" }
      

      In looking at the commit that changed this behavior, other commands are probably affected as well.

      Show
      For reference when reading the following: a Ruby symbol is represented in the form :symbol and is serialized to the BSON Symbol type. Using the most recent Ruby driver (1.12.0.rc0), with MongoDB server version 2.6: client = MongoClient. new db = client[ 'test' ] db.create_collection(:foo) db.drop_collection(:foo) => true This is what mongosniff shows: 127.0.0.1:56381 -->> 127.0.0.1:27017 admin.$cmd 58 bytes id:e 14 query: { drop: "foo" } ntoreturn: -1 ntoskip: 0 127.0.0.1:27017 <<-- 127.0.0.1:56381 88 bytes id:f 15 - 14 reply n:1 cursorId: 0 { ns: "admin.foo" , nIndexesWas: 1, ok: 1.0 }   With MongoDB nightly Nov-18-2014 and the most recent Ruby driver (1.12.0.rc0): client = MongoClient. new db = client[ 'test' ] db.create_collection(:foo) db.drop_collection(:foo) => false And this is the mongosniff output 127.0.0.1:56381 -->> 127.0.0.1:27017 admin.$cmd 58 bytes id:13 19 query: { drop: "foo" } ntoreturn: -1 ntoskip: 0 127.0.0.1:27017 <<-- 127.0.0.1:56381 94 bytes id:14 20 - 19 reply n:1 cursorId: 0 { ok: 0.0, errmsg: "no collection name specified" } In looking at the commit that changed this behavior, other commands are probably affected as well.

      The server no longer accepts the Symbol BSON type for some command values. In particular, the 'drop' command is affected.

      I believe it is because of this commit https://github.com/mongodb/mongo/commit/d41f98bd0fdc3d392fc19aadfdc62a020d17fede

            Assignee:
            matt.kangas Matt Kangas
            Reporter:
            emily.stolfo Emily Stolfo
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: