I'm trying to integrate NATS with RisingWave for streaming event data and I'm curious about handling complex JSON schemas. For instance, I have JSON data with nested objects and arrays, like this example:
e.g. {
"_id": "65eef1068643fc050faa3558",
"href": "reserveBalance/65eef1068643fc050faa3558",
"confirmationDate": {
"$date": "2024-03-11T11:54:46.575Z"
},
"reason": "Charging",
"requestedDate": {
"$date": "2024-03-11T11:54:46.545Z"
},
"amount": {
"amount": 100,
"units": "MB"
}
}```
Is there a recommended approach for defining schemas in RisingWave to match this kind of complex JSON data?
Declan Harrison
Asked on Mar 14, 2024
Yes, it is possible to define more complex schema that can store JSON data. RisingWave supports numerous JSON functions and operators. You can refer to the RisingWave documentation for JSONB data types and JSON functions to understand how to define and work with complex JSON schemas in the database. Here are the links to the documentation:
The mapping of the JSON to the columns is done automatically, so you should be able to handle complex JSON structures out of the box with the right schema definitions.