how to implement nested query in java API

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: API
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

       

      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.

            Assignee:
            Unassigned
            Reporter:
            jacky chen
            None
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: