[SERVER-47958] Explain shell helpers for CRUD API Created: 05/May/20  Updated: 07/Dec/20  Resolved: 07/Dec/20

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

Type: Improvement Priority: Major - P3
Reporter: David Percy Assignee: Ted Tuckman
Resolution: Duplicate Votes: 0
Labels: qopt-team, quick-tech-debt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

The .explain() method in the shell works with some write methods (update, remove, findAndModify, as of SERVER-14101), but it doesn't work with the newer CRUD API (added to the shell as of SERVER-17953).

I think the missing explain methods are:

> Object.keys(Object.getPrototypeOf(db.c)).sort().filter(x => x.match(/One|Many/))
[
	"deleteMany",
	"deleteOne",
	"findOne",
	"findOneAndDelete",
	"findOneAndReplace",
	"findOneAndUpdate",
	"insertMany",
	"insertOne",
	"replaceOne",
	"updateMany",
	"updateOne"
]

I think this would be especially helpful for new hires: explain is a good way to quickly find the code that implements a command.



 Comments   
Comment by Massimiliano Marcon [ 07/Dec/20 ]

Posted to our feedback portal to track it as a feature request for the new MongoDB Shell: https://feedback.mongodb.com/forums/929233-mongodb-shell/suggestions/42140065-explain-shell-helpers-for-crud-api.

Comment by Craig Homa [ 05/May/20 ]

To whoever picks this up, please chat with the team working on the new shell to gather their feedback first (or at least for an FYI).

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