Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-1666

Shell helpers should not silently accept invalid options

    • Type: Icon: Task Task
    • Resolution: Works as Designed
    • Priority: Icon: Minor - P4 Minor - P4
    • No version
    • Affects Version/s: None
    • Component/s: None
    • None
    • Not Needed
    • Developer Tools

      Mongo shell helpers silently accept invalid options

      MongoDB Enterprise > db.inventory.find({"item": "canvas"}, {_id: 0}, {dummyOption: true})
      
      { "item" : "canvas", "qty" : 100, "tags" : [ "cotton" ], "size" : { "h" : 28, "w" : 35.5, "uom" : "cm" } } 

      In other environments or drivers such as the Python one, that would have resulted in an error

      TypeError: find() got an unexpected keyword argument 'dummyOption' 

            Assignee:
            Unassigned Unassigned
            Reporter:
            c.alonso@mongodb.com Carlos Alonso PĂ©rez
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: