Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-1887

Query taking too much to execute on driver, but executing normally in Mongo Console

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: 3.1.12
    • Component/s: Core
    • Labels:

      I have this code snippet but is taking too much to execute the query, but executing in the mongo console is executing in an acceptable time
       

      for (const productId of productsGrouppedByCategory[group]) {
         const _id = Types.ObjectId(productId)
         ids.push(_id);
         const products = collection.find({ '_id': { '$in': ids }}, {'projection': {'priceHistory': 0}}).toArray()
         result.push(products)
      }
      

      I already updated the poolSize value, but nothing happens, it takes about 10 seconds to execute this query, when in the mongo console takes 4 seconds.
       

            Assignee:
            daniel.aprahamian@mongodb.com Daniel Aprahamian (Inactive)
            Reporter:
            olegario Gustavo Figueira Olegário
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: