So I have a lot of .js files that I have used to query MongoDB from the Command Line Interface before, but now I want to be able to run those same queries through Java (I am using Java to back a web interface that relies on the information from the query). How can I use those JavaScript queries from the Java driver and return some data that I can work with (the end game is to format the result into HTML, if that helps).
If you need to executye your js files during buildtime, you can use maven-mongodb-plugin. This plugin uses db.eval()...
using Java IO to read your js files, filter the queries , execute the queries.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With