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

db.stats() seems to show incorrect number of collections

    • Type: Icon: Question Question
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      The number of collections returned by db.stats() seems to correspond neither with the number of collection nor the number of namespaces. Paste this into the shell:

      use teststats
      db.stats()['collections'];
      db.system.namespaces.find().length();

      db.foo.save(

      {a:1}

      );
      db.stats()['collections'];
      db.system.namespaces.find().length();

      db.bar.save(

      {a: 1}

      )
      db.stats()['collections'];
      db.system.namespaces.find().length();

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            kbanker Kyle Banker
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: