-
Type:
Improvement
-
Resolution: Duplicate
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
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.