XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Internal Code
    • None
    • Fully Compatible
    • ALL

    Description

      The while (cursor.hasNext()) loops indefinitely. collection.count() == 1520

      public void queryCollectionAll() {
      /*NOTE
      finally to ensure cursor is closed so no leaking*/
      MongoCollection<Document> collection = database.getCollection("test");
      MongoCursor<Document> cursor = collection.find().iterator();
      long count= 0;
      System.out.println(collection.count());
      try {
      while (cursor.hasNext())

      { count++; }

      } finally

      { cursor.close(); System.out.println("collection.count():"+count); }


      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            stanlick James Scott Stanlick
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: