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

XMLWordPrintableJSON

    • Type: Question
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • 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 Stearn
              Reporter:
              Kyle Banker (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: