kotlinx-serialization-jsonpath
kotlinx-serialization-jsonpath copied to clipboard
BSON integration
Hey!
I'm working a JsonPath implementation for BSON (MongoDB's wire format).
The implementation is centered around the method:
inline fun <reified T : Any?> Bson.select(path: BsonPath): Sequence<T>
The implementation is mainly targeting users who have large BSON payloads but are only interested in a few fields (a typical example is a the output of a query plan). Since my BSON implementation is lazily-parsed, JsonPath offers significant performance benefits in this situation as opposed to parsing the entire payload.
Still, in a more general case, I think there is value in integrating this system with Arrow Optics and this library. Potentially, this would allow JsonPath expressions from this library to also work on BSON data, and the other way around.
However, I am not very familiar with Optics so I'm not sure what the best way forward would be. What do you think?