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

mongod and mongos result format for collMod differs

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.0.1
    • Component/s: Sharding
    • Labels:
      None
    • Sharding
    • ALL

      The documentation at https://docs.mongodb.com/manual/reference/command/collMod/#change-expiration-value-for-indexes shows the result document as:

      { "expireAfterSeconds_old" : 1800, "expireAfterSeconds_new" : 3600, "ok" : 1 }
      

      We expect this format for the https://docs.mongodb.com/php-library/master/reference/method/MongoDBDatabase-modifyCollection/ method. However, we are adding additional topologies for our tests, and noticed that with a sharded cluster, the output format changes to:

      {
      	"raw" : {
      		"localhost:4100" : {
      			"ok" : 0,
      			"errmsg" : "ns does not exist",
      			"code" : 26,
      			"codeName" : "NamespaceNotFound"
      		},
      		"localhost:4200" : {
      			"expireAfterSeconds_old" : NumberLong(500),
      			"expireAfterSeconds_new" : 700,
      			"ok" : 1
      		}
      
      	},
      	"ok" : 1,
      	"operationTime" : Timestamp(1534859095, 4),
      	"$clusterTime" : {
      		"clusterTime" : Timestamp(1534859095, 4),
      		"signature" : {
      			"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
      			"keyId" : NumberLong(0)
      		}
      	}
      }
      

      This makes our test fail.

      I would argue that the outputs should always be the same, or documented in some form.

            Assignee:
            backlog-server-sharding [DO NOT USE] Backlog - Sharding Team
            Reporter:
            derick Derick Rethans
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: