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'

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • IDL
    • Service Arch
    • Security 2019-06-03

    Description

      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'.

       

      Attachments

        Activity

          People

            backlog-server-servicearch Backlog - Service Architecture
            anton.korshunov@mongodb.com Anton Korshunov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: