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'

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: IDL
    • Service Arch
    • 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:
            backlog-server-servicearch [DO NOT USE] Backlog - Service Architecture
            Reporter:
            anton.korshunov@mongodb.com Anton Korshunov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: