Striim 3.10.1 documentation

Converting MongoDB output to a user-defined type

Using the application and data from MongoDBReader example application and output, the following CQ would convert the JSONNodeEvent data array values to a Striim type, which could then be consumed by any other Striim component.

INSERT INTO EmployeeStream
SELECT data.get("_id").toString() AS id,
  data.get("firstname").toString() AS firstname,
  data.get("lastname").toString() AS lastname,
  data.get("age").toString() AS age
FROM MongoDBStream;