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

Don't understand the difference between these queries:

    XMLWordPrintableJSON

Details

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

    Description

      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);

      ??

      Attachments

        Activity

          People

            Unassigned Unassigned
            rex@phonefusiondev.com Bruce Rex
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: