XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Internal Code
    • None
    • Fully Compatible
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

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


      }

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

              Created:
              Updated:
              Resolved: