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

"indexOf is not a function" error for collection name "1000" in shell

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Shell
    • None
    • ALL
    • Hide
      breaking-serverless-1-shard-00-01(mongos-4.9.0-rc0)[mongos] CORE> db.check.insertOne({})
      {
        "acknowledged": true,
        "insertedId": ObjectId("6074aad76e02669be98128d8")
      }
      breaking-serverless-1-shard-00-01(mongos-4.9.0-rc0)[mongos] CORE> db.check.aggregate({$out: "10000"})
      {
        "cursor": {
          "firstBatch": [ ],
          "id": NumberLong("0"),
          "ns": "CORE.check"
        },
        "ok": 1,
        "$clusterTime": {
          "clusterTime": Timestamp(1618258651, 15009),
          "signature": {
            "hash": BinData(0, "DmTvCASPK04UTi/hhR+6fpgIq/I="),
            "keyId": NumberLong("6948896105811673091")
          }
        },
        "operationTime": Timestamp(1618258651, 15009)
      }
      breaking-serverless-1-shard-00-01(mongos-4.9.0-rc0)[mongos] CORE> show collections
      10000 → 0.000MB / 0.008MB
      check → 0.000MB / 0.008MB
      breaking-serverless-1-shard-00-01(mongos-4.9.0-rc0)[mongos] CORE> db["10000"].find()
      TypeError: this._collection.getName(...).indexOf is not a function
      
      Show
      breaking-serverless-1-shard-00-01(mongos-4.9.0-rc0)[mongos] CORE> db.check.insertOne({}) { "acknowledged" : true , "insertedId" : ObjectId( "6074aad76e02669be98128d8" ) } breaking-serverless-1-shard-00-01(mongos-4.9.0-rc0)[mongos] CORE> db.check.aggregate({$out: "10000" }) { "cursor" : { "firstBatch" : [ ], "id" : NumberLong( "0" ), "ns" : "CORE.check" }, "ok" : 1, "$clusterTime" : { "clusterTime" : Timestamp(1618258651, 15009), "signature" : { "hash" : BinData(0, "DmTvCASPK04UTi/hhR+6fpgIq/I=" ), "keyId" : NumberLong( "6948896105811673091" ) } }, "operationTime" : Timestamp(1618258651, 15009) } breaking-serverless-1-shard-00-01(mongos-4.9.0-rc0)[mongos] CORE> show collections 10000 → 0.000MB / 0.008MB check → 0.000MB / 0.008MB breaking-serverless-1-shard-00-01(mongos-4.9.0-rc0)[mongos] CORE> db[ "10000" ].find() TypeError: this ._collection.getName(...).indexOf is not a function

      • You can use the $out operator to create collection with numeric names
      • Further operations on this collection will fail

            Assignee:
            eric.sedor@mongodb.com Eric Sedor
            Reporter:
            andrew.marshall@mongodb.com Andrew Marshall
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: