[SERVER-29294] make `db.createView()` command return the number of documents in the view Created: 19/May/17  Updated: 06/Dec/22  Resolved: 19/May/17

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

Type: Improvement Priority: Minor - P4
Reporter: adrien petel Assignee: Backlog - Storage Execution Team
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-61611 extend OpObserver::aboutToDelete() to... Closed
Assigned Teams:
Storage Execution
Backwards Compatibility: Fully Compatible
Participants:

 Description   

It would be nice if the creation of a view could return the number of documents in the view (as for insert/remove/update which provides stats on the performed operation )

for example, it could looks like this:

> db.createView("out", "test", {$match: {field: "random"}})
{ 
     "ok" : 1,
     "nDocsInView": 254 
}



 Comments   
Comment by Ian Whalen (Inactive) [ 26/Apr/19 ]

Switching "Drivers Changes Needed" from "Maybe" to "Not Needed" since this was closed as something other than Fixed.

Comment by Ian Whalen (Inactive) [ 19/May/17 ]

We don't want to add any overhead to creating a view, and it is possible (and more consistent with MongoDB's API) to get this data using a count() before creating the view.

Comment by Ramon Fernandez Marina [ 19/May/17 ]

Thanks for your report, I'm sending this to the Storage team for consideration.

Generated at Thu Feb 08 04:20:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.