MongoDB (Java) - How to run query saved in javascript file?

后端 未结 3 1805
闹比i
闹比i 2021-01-01 07:57

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

相关标签:
3条回答
  • 2021-01-01 08:30

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

    0 讨论(0)
  • 2021-01-01 08:40

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

    0 讨论(0)
  • 2021-01-01 08:40

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

    0 讨论(0)
提交回复
热议问题