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

Explain shell helpers for CRUD API

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None

    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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: