Long hang time with mongo.find()

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Gone away
    • Priority: Major - P3
    • None
    • Affects Version/s: 3.10
    • Component/s: Query Operations
    • None
    • Environment:
      Python 3.5
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Hello, I'm having an issue withthe db.find() function. I'm running a for each loop(see below code for format) and get stuck at the 101st element every time, where it hangs for about 10s. After hanging for the 10s it goes through the other elements just fine. I tried using a large batch size on the query but it just shifts that 10s hanging and makes the first element hang for about 10s. I'm running this in pycharm(if that's relavent).
      I've looked at similar tickets and:
      py.has_c() = True

      The code where it hangs is a for each loop in the below format:

       

      query_results = database.find(query)
      for
      x in query_results: # after getting to the 101st element, it hangs here
            *relavent code executed*

              Assignee:
              Shane Harvey
              Reporter:
              Andrej Glavic
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: