Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2915

how to implement nested query in java API

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • API
    • None

    Description

       

      db.a.find({ "id" :

      { "$in" : ["3", "5"] }

      })

      for this query, I just create a filter like below bson object which is workable.

      new BasicDBObject("id", new BasicDBObject("$in", new String[] {"3", "5"]));

       

      db.a.find({ "id" :

      { "$in" : db.b.distinct("id") }

      })

      for this second query, is there a way to create a BasicDBObject for filter object.

      I mean how to express nested query body, db.b.distinct("id"), in BasicDBObject.

      Attachments

        Activity

          People

            Unassigned Unassigned
            8666592@qq.com jacky chen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: