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

  • SEARCH
  • Home
  • 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 7929953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:15:34+00:00 2026-06-03T20:15:34+00:00

I am using C# Mongo DB Driver for database operation. I want to get

  • 0

I am using C# Mongo DB Driver for database operation.

I want to get the list of records order by the way records are inserted. Because I believe MongoDB by default sorts data on it’s primary key (e.g. _Id),

I want to get the list of records by the order based on the way it was inserted. (I don’t want to store DateTime data in table document).

Thanks in advance!

  • 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-03T20:15:36+00:00Added an answer on June 3, 2026 at 8:15 pm

    Yes, you’re right. If you don’t provide a value of _id field on insertion, MongoDB will generate one. And those values will increase with time. So, if you sort by _id in ascending order, you’ll get insertion order (accurate to the second, if I’m not mistaken).

    For capped collections, there’s a special sorting order available: $natural. It is a guaranteed insertion order (but only for capped collections).

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

Sidebar

Related Questions

I am using mongo-ruby-driver, I want to get stats/query graphs to show for Mongo.
I want to upsert a document with the mongo-ruby-driver using something like the following-
I am currently playing around with node.js and MongoDB using the node-mongo-native driver. I
I'm using the MongoDB Java driver, and can't seem to get a query to
I'm trying to access mongo using the mongodb haskell drivers (the snap driver appears
related to MongoDB Group using Ruby driver if I want to do something like
I am using the MongoDB-Csharp driver and I was wondering what the proper way
Uing Ruby (1.8.7) and Mongo Driver, I've written this: @data['Users'] = [] @database['user_facilities'].find({ :facility_id
How do I query MongoDB for nearby geographic points using the C# driver and
I am using Mongodb Java driver for my Java client application. it needs to

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.