3

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).

0

3 Answers 3

2

If you need to executye your js files during buildtime, you can use maven-mongodb-plugin. This plugin uses db.eval()...

Sign up to request clarification or add additional context in comments.

Comments

2

using Java IO to read your js files, filter the queries , execute the queries.

Comments

1

This not possible in an efficient way in current JAVA driver. Have a look here : mongodb java driver - raw command?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.