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

IDL should differentiate when an optional field was not specified, or specified as 'null'

    • Server Programmability
    • Security 2019-06-03

      Currently there is no way to tell if an optional field wasn't specified in the document, or was set to 'null'. E.g., if 'foo' is an optional field, then 'if (doc.getFoo())' will be false for the following two documents:

      {foo: null} 
      {}

      However, semantically, not specifying a field, and setting it to 'null' may have different meanings. So, the IDL should provide a mechanism to check whether an optional field didn't exist in the document, or its value is 'null'.

       

            Assignee:
            Unassigned Unassigned
            Reporter:
            anton.korshunov@mongodb.com Anton Korshunov
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: