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

Add support for $emit with RelaxedJSON

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Blocker - P1 Blocker - P1
    • 8.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Atlas Streams
    • Fully Compatible
    • Sprint 46

      Some customers like 7-11 have voiced that they do not want to have to handle the Canonical Extended JSON format as standard JSON datatypes are not represented as they would expect. To help resolve this objection, we need to support the Relaxed Extended JSON format so that only BSON datatypes are reconstructed in a portable way. 

      We should change the default output to be Relaxed Extended JSON, with the option to utilize Canonical. 

       

      Enhance $emit to support selecting the format which is only Valid with Kafka Topic emits.

       

      {$emit : {
             connectionName : "KafkaProd",
             topic : "stockData_1",        
             config : {outputFormat : "relaxedJson | canonicalJson"}
                }
      }

       

       

      More information on Canonical vs Relaxed Extended JSON

      https://www.mongodb.com/docs/manual/reference/mongodb-extended-json/ 

       

      Relaxed ExtendedJSON looks like so

      {
              "_id": {
                      "$oid": "63c1c7e021ff36967b47eab5"
              },
              "cdate": {
                      "$date": "2019-04-29T13:12:00Z"
              },
              "tim": {
                      "$timestamp": {
                              "t": 1673644000,
                              "i": 1
                      }
              },
              "String": "a string",
              "boolean": true,
              "int": 1,
              "double": 1.101,
              "object": {
                      "test1": 1,
                      "test2": "val2"
              },
              "array": [1, "2", 3.3, {
                      "test1": 1,
                      "test2": "val2"
              }],
              "none": null
      } 

            Assignee:
            jagadish.nallapaneni@mongodb.com Jagadish Nallapaneni
            Reporter:
            joe.niemiec@mongodb.com Joe Niemiec
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: