Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-47958

Explain shell helpers for CRUD API

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

            Assignee:
            ted.tuckman@mongodb.com Ted Tuckman
            Reporter:
            david.percy@mongodb.com David Percy
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: