Executing Mongo like Query (JSON)through Java

后端 未结 5 1576
执笔经年
执笔经年 2020-12-25 14:54

I was wondering if there is a way to execute mongo like query directly through Java i.e. we give mongoDB like query as a String to a function in Java driver for mongoDB as a

5条回答
  •  醉梦人生
    2020-12-25 15:40

    You can follow the example in the tutorial:

    http://www.mongodb.org/display/DOCS/Java+Tutorial#JavaTutorial-GettingASetofDocumentsWithaQuery

    Note their use a of (Basic)DBObject to create the query, not a string.

提交回复
热议问题