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 3338124
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:20:14+00:00 2026-05-18T00:20:14+00:00

I am experimenting with Mongodb and NoRM in C#. From what I have read

  • 0

I am experimenting with Mongodb and NoRM in C#.

From what I have read the ObjectId that uniquely identifies a document in Mongodb is a sort of “special” Guid (in the sense that is unique) but has some significant parts in it that permit a more easy sorting and indexing (timestamp,machine hash,processId and increment in it).

I’d like to keep my objects really POCO with an autogenerated Guid as Id so with no external types like ObjectId that would prevent me to migrate to another technology or go back to classic Ado.net or Nhibernate stuff.

Another option would be to use in the POCO an Id as string and use ObjectId.NewObjectId().ToString()

What are the best practices for it?

  • 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-05-18T00:20:14+00:00Added an answer on May 18, 2026 at 12:20 am

    ObjectId are not guids. Guid is the name that MS gives for the version of UUID that they use. ObjectIds are a completely different algorithm.

    That being said, you can use whatever you like as an ID in mongo, and it won’t have performance penalties (in the rails world, a few of the ORMs advocate using strings)

    ObjectId is used in mongo mostly to save size. If it is that big a deal, just use something else, just realize that using needlessly large ID fields will end up just wasting ram. But if it is a big deal, then go for Guids.

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

Sidebar

Related Questions

I'm currently experimenting with MongoDB . I'm moving from a NHibernate/SQL mindset, and so
When experimenting with (embedded) Apache Derby DB, I noticed that a fresh database, with
I've started experimenting with Hudson as a build server. I'm using subversion and have
While experimenting with iPhone app development, we have several AppIDs which should be deleted
I am currently experimenting with various input controls and have stumbled upon SneakyInput, which
Experimenting with Cocos2D collection detection and have some questions. First, some background: This is
Just experimenting and learning, and I know how to create a shared dictionary that
I experimenting with Flex Styling, and I came across an alignment issue. I have
I've been experimenting with the standard python math module and have come across some
I'm experimenting with MongoDB using the PHP PECL extension, however I'm having difficulty getting

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.