Don't understand the difference between these queries:

XMLWordPrintableJSON

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

      given this SQL query:
      query = "select SESSION_ID from SESSIONS where PLAYER_ID='" + playerId + "' and END_DTS is null";

      why does this work:
      BasicDBObject condQry = new BasicDBObject("player_id", playerId).append("session_end_dts", 0L);
      BasicDBObject fldsQry = new BasicDBObject("session_id", 1);

      cur = coll.find(condQry, fldsQry);

      but this does not:
      query.put("session_id", new BasicDBObject("player_id", playerId)).append("session_end_dts", 0L).append("session_id", 1));
      cur = coll.find(query);

      ??

            Assignee:
            Unassigned
            Reporter:
            Bruce Rex
            None
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: