Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-1285

Mongo cursor return less entities than it has.

    • Type: Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: 1.4.3
    • Component/s: Querying
    • Labels:
      None
    • FreeBSD

      When I try fetch many big entities from cursor, it's return less than it has.
      When I fetch not so match big entities, or small entities, cursor work correctly.
      The more memory the object occupies, the less its returns cursor.
      Maybe cursor have memory limit. And if entities summary size more than it limit, cursor return not all entities.

      Mongo version 1.4.3

      Examples:
      > var cursor = db.test_coll.find().skip(0).limit(400).toArray();
      > cursor.length;
      289

      But I have more than 289 entities:
      > var cursor = db.test_coll.find().skip(0).limit(400);
      > cursor.count(true);
      400
      > var cursor = db.test_coll.find().skip(400).limit(100).toArray();
      > cursor.length;
      100
      > var cursor = db.test_coll.find().skip(400).limit(400).toArray();
      > cursor.length;
      283

      If I run query witout limit, cursor return less entities:
      > var cursor = db.test_coll.find().toArray();
      > cursor.length;
      71
      > var cursor = db.test_coll.find();
      > cursor.count(true);
      835

      It problem I have in mongo console and in PHP API:
      $data = $mongo_collection_handler->find(array())>skip(0)>limit(400);
      echo $data->count(true); // return 835
      $counter = 0;
      foreach ($data as $value){
      $counter++;
      }
      echo $counter; // return 289

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            pavel.pipkin Pavel Pipkin
            Votes:
            4 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: