Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8434273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:36:45+00:00 2026-06-10T06:36:45+00:00

(asked on mongo-user discussion group https://groups.google.com/d/topic/mongodb-user/i1ge4bNiMgM/discussion ) Hi, i’d like to use MongoDB as

  • 0

(asked on mongo-user discussion group https://groups.google.com/d/topic/mongodb-user/i1ge4bNiMgM/discussion)

Hi, i’d like to use MongoDB as a message queue and thought about using a capped collection + tailable cursor for that purpose.
I know that the tailable cursor can be used for accessing documents in the insertion order but

  1. can I use any sort order for the cursor?
  2. does a tailing cursor work with a filter query (to skip some documents I don’t want to process)? If so, how does it handle insertion of new documents – will I be notified only if the new document matches the query criteria?
  3. Are tailing cursors fully supported by C# driver?
  4. I’d like my queue to guarantee single delivery – I mean if two clients try to read messages from the same collection they shouldn’t be able to ‘consume’ the same message. I think this could be achieved with findAndModify, but how to do that with tailing cursor?

Thanks
RG

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T06:36:46+00:00Added an answer on June 10, 2026 at 6:36 am

    There was a presentation from AOL/About.me on “MongoDB as message queue” at the Silicon Valley MUG in April, 2012 that you may find helpful in planning your approach.

    1. can I use any sort order for the cursor?
    2. does a tailing cursor work with a filter query (to skip some documents I don’t want to process)? If so, how does it handle insertion of new documents – will I be notified only if the new document matches the query criteria?

    A tailable cursor tails the end of a capped collection and only in natural order. If you want a sort order you need to use an indexed query instead.

    Please have a read of the Create Tailable Cursor documentation page for more information.

    Are tailing cursors fully supported by C# driver?

    Yes, tailable cursor support was implemented in the 1.1 C# driver (see: code example).

    I’d like my queue to guarantee single delivery – I mean if two clients try to read messages from the same collection they shouldn’t be able to ‘consume’ the same message. I think this could be achieved with findAndModify, but how to do that with tailing cursor?

    There are a few approaches:

    • Have a single reader with the tailable cursor distribute tasks to worker threads (i.e. based on worker queue depth or round-robin). This will be more efficient than having multiple readers, but is potentially a single point of failure.
    • (suggested by @Contango in comment below) Have multiple readers, but use optimistic concurrency to ensure that only one worker “owns” each task. This will result in more I/O, but may simplify your design if the workers are also tailing directly.

    For more information on atomic operations, see Isolate Sequence of Operations in the MongoDB manual.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Recently I asked for $in when using mongoose.someModel.find({$in}) https://stackoverflow.com/questions/11839765/whats-wrong-with-in-in-mongoose After restarting node for a
Asked and Answered on Super User I am attempting to install Windows XP on
I asked a question to install F# powerpack and use it here . error
my mongoDB is hosted on Mongo Lab and i am using C# as the
Years ago someone asked why c# doesn't allow incremental compilation like Java . El
Asked an unrelated question where I had code like this: public boolean equals(Object obj)
I asked a similar question in the android developers group but haven't received a
Asked this question question recently and was advised to use the ' to.minutes5() '
Jacob asked the perfect question: give me the MERGE syntax . Every answer out
I asked my friend if he can print from 1 to 1000 without using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.