Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

525
Views
MongoDB Error: Cannot run getMore on cursor without an lsid

I have been searching for an answer online for the past day, to no avail.

My collection has over 1m documents. My collection schema looks like:

{
  "_id" : ObjectId("61c26416e3c899307cf0507b")"id" : 6,
  "name" : "Pumped Up Kicks",
  "slogan" : "Faster than a just about anything",
  "description" : "The Pumped Up serves up crisp court style with a modern look. These shoes show off tennis-whites shades and are constructed with a supple leather upper and a classic rubber cupsole.",
  "category" : "Kicks",
  "default_price" : 89
}

The query I am trying:

products
    .find()
    .forEach(doc => console.log(doc))

Just a simple query to start out, trying to familiarize myself with how MongoDB handles querying large amounts of data. I am trying to return all documents so that I may perform an action on them afterward. As of now, I am unable to proceed beyond this point. I am receiving this error as soon as I execute the code:

MongoServerError: Cannot run getMore on cursor 2168550933558261062, which was created in session 2197b8e7-1fec-4c0a-84ea-121a380ae69f - 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=, without an lsid
    at MessageStream.messageHandler (/Users/joshfuqua/HackReactor/SDC/product-overview/node_modules/mongodb/lib/cmap/connection.js:462:30)
    at MessageStream.emit (node:events:394:28)
    at processIncomingData (/Users/joshfuqua/HackReactor/SDC/product-overview/node_modules/mongodb/lib/cmap/message_stream.js:108:16)
    at MessageStream._write (/Users/joshfuqua/HackReactor/SDC/product-overview/node_modules/mongodb/lib/cmap/message_stream.js:28:9)
    at writeOrBuffer (node:internal/streams/writable:389:12)
    at _write (node:internal/streams/writable:330:10)
    at MessageStream.Writable.write (node:internal/streams/writable:334:10)
    at Socket.ondata (node:internal/streams/readable:754:22)
    at Socket.emit (node:events:394:28)
    at addChunk (node:internal/streams/readable:315:12) {
  ok: 0,
  code: 50737,
  codeName: 'Location50737'
}

Also, limiting the query results to a few thousand yields the same result. It appears to only allow me to query less than 100 at a time.

I have checked in multiple forums, the MongoDB Documents, the MongoDB API Docs, and have yet to find anything. The only thing I've been able to find related to this "lsid" error are forum answers to similar questions referencing timeout issues. As I said, this error is instantaneous.

I would greatly appreciate any help. I will also gladly provide any other necessary info to help troubleshoot this problem.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!