[SERVER-1162] db.stats() seems to show incorrect number of collections Created: 27/May/10  Updated: 04/Jul/10  Resolved: 25/Jun/10

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Question Priority: Major - P3
Reporter: Kyle Banker Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-1308 system.namespaces doesn't have an ent... Closed
Participants:

 Description   

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();



 Comments   
Comment by Mathias Stearn [ 25/Jun/10 ]

db.stats correctly returns the number of collections. The issue is that db.system.namespaces doesn't include itself. see SERVER-1308

Generated at Thu Feb 08 02:56:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.