C driver for MongoDB: Is there an API for executing JS?

Hi everyone! I’m working on a database client app for Mac and would like to include full MongoDB support as seen in e.g. Robo 3T.

Is it possible to execute a string of MongoDB Shell JavaScript using the C driver or anything similar? For example, I’d like to execute “db.products.find({})" or “db.find.help()" against a database I’ve connected to and have it return results.

Maybe I haven’t been looking in the right places. In Robo 3T they’re not using the C driver, but instead a fork of the main MongoDB C++ code compiled as a library in a super convoluted way, and now I’m not sure if I need to go this same route or if an easier solution exists today.