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

Mongo allows for creation of collections named the same as functions, it's confusing

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 1.8.3
    • Component/s: Shell
    • Labels:
      None
    • ALL

      > show collections
      contact
      fs.chunks
      group
      system.indexes
      system.profile
      > db.group.stats()
      Thu Sep 15 12:38:48 TypeError: db.group.stats is not a function (shell):1
      > x=db.getCollection("group")
      platform_addressbook.group
      > x.stats()
      {
      	"ns" : "platform_addressbook.group",
      	"count" : 15863,
      	"size" : 1899448,
      	"avgObjSize" : 119.74078043245288,
      	"storageSize" : 2531584,
      	"numExtents" : 5,
      	"nindexes" : 3,
      	"lastExtentSize" : 1900544,
      	"paddingFactor" : 1.0099999999999996,
      	"flags" : 0,
      	"totalIndexSize" : 3268608,
      	"indexSizes" : {
      		"_id_" : 1171456,
      		"userId_1_type_1" : 1171456,
      		"userId_-1_name_-1" : 925696
      	},
      	"ok" : 1
      }
      >
      > db.group
      function (parmsObj) {
          var ret = this.runCommand({group:this._groupFixParms(parmsObj)});
          if (!ret.ok) {
              throw "group command failed: " + tojson(ret);
          }
          return ret.retval;
      }
      
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            kgorman Kenny Gorman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: