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

Streams: Better error message for TypeMismatch: BSON field '$emit.config.headers' is the wrong type 'array', expected types '[']

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • Sprint 56

       

      The below pipeline leads to a bad error message. The "expected types" should read 'object or string' instead of '['.

      The relevant code here is planner.cpp. We should be able to test the fix using a unit test in planner_test.cpp (no need to test this against real kafka using kafka.js)  

      AtlasStreamProcessing> sp.process([{$source: {connectionName: "DemoKafka", topic: "t1"}}, {$emit: {connectionName: "DemoKafka", topic: "t2", config: {headers: [{k: "keyname", v: "value"}]}  }}])
      
      MongoServerError: Failed to create stream processor: TypeMismatch: BSON field '$emit.config.headers' is the wrong type 'array', expected types '[']: TypeMismatch: BSON field '$emit.config.headers' is the wrong type 'array', expected types '[']: TypeMismatch: BSON field '$emit.config.headers' is the wrong type 'array', expected types '['], correlationID = 17dcefc2a7305a54d75a7e95 

       

       

       

            Assignee:
            andrea.rahmanan@mongodb.com Andrea Rahmanan
            Reporter:
            matthew.normyle@mongodb.com Matthew Normyle
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: