[SERVER-16521] Make listCollections() an aggregation source Created: 11/Dec/14 Updated: 06/Dec/22 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Usability |
| Affects Version/s: | 2.8.0-rc2 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Hannes Magnusson | Assignee: | Backlog - Query Execution |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Assigned Teams: |
Query Execution
|
||||||||||||||||
| Backwards Compatibility: | Major Change | ||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
Before the listCollections command came about, drivers/users could run a count on systems.collections to find how many collections are in a database. Moving to use dbStats now, but that returns how many collections are in a database, total. This is a request to make the number of user collections available somehow, likely in dbStats. Getting a count with a filter/query is needed too. |
| Comments |
| Comment by Hannes Magnusson [ 13/Dec/14 ] |
|
I am not aware of an actual helper that does this in drivers. It just came up as an interesting side effect of being a command now - how can we know how many results a command cursor has? |
| Comment by Scott Hernandez (Inactive) [ 12/Dec/14 ] |
|
The current way to do this is to count on the client. We will evaluate if this is sufficient or if doing the count on the server is needed, without sending the client the actual data. |
| Comment by Christian Amor Kvalheim [ 12/Dec/14 ] |
|
It's not a client side api that's the issue it's using the normal count command on the system.namespace collection. I don't know if people are using this or not but we should probably verify the risk of not allowing collection name count. of the top of the head I can imagine some "admin" tools for mongodb does something like this to show stats. |
| Comment by Scott Hernandez (Inactive) [ 12/Dec/14 ] |
|
bjori, christkv, what client APIs exist today that need this? In both php and node.js I only see listCollection type functions. |