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

224
Views
MongoDB tailable cursor timeout

I'm looking into using mongodb for a pub-sub model. I went through different articles like http://tugdualgrall.blogspot.fr/2015/01/how-to-create-pubsub-application-with.html and https://jpaljasma.blogspot.com/2013/11/howto-mongodb-tailable-cursors-in-nodejs.html.

I had a question on the numberOfRetries option on the cursor. If i set the option {'numberOfRetries': -1} will this ensure that the cursor will not timeout? Which means that i'll be able to get any new documents inserted into the capped collection even if there was a long delay in a document getting added to the collection?

Thanks.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You can set a cursor flag, specifically the noCursorTimeout flag:

let cursor = collection.find({}, ...).addCursorFlag('noCursorTimeout', true);
over 4 years ago · Santiago Trujillo Report
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!