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

Some Document Can Not Be Found By Mongo Java Client

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Works as Designed
    • Icon: Unknown Unknown
    • None
    • None
    • None

    Description

      Summary

      Some Document Can Not Be Found By Mongo Java Clinet。

      client version:4.5.1

      server version: 4.2.5

      Java Code:

      ```
      long l = database.getCollection("currency_log").countDocuments( Filters.and( Filters.gte("time", 1647792000), Filters.lt("time", 1647878400) ) );
      ```

      return count is :588177

      Query Ql In Tool:NoSQLBooster for MongoDB

      ```
      db.currency_log.find({time:{"$gte":1647792000,"$lt":1647878400}}).count()
      ```

      return count is :588178

       

      Then I Find The Lose Document is 

      ```
      db.currency_log.find({_id:ObjectId("62388633f12eb410f0e6d922")})
      ```

      The I just find Document By ObjectId By Java Mongo Driver , But Still Not Find Id;

      Java Code is below

      ```
      long count = database.getCollection("currency_log").countDocuments(Filters.eq("_id", new ObjectId("62388633f12eb410f0e6d922")));
      ```

       

       

      Attachments

        Activity

          People

            ross@mongodb.com Ross Lawley
            onemail1876@gmail.com 仲鲍 杨
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: