https://github.com/junyugit/nobjectid
objectid from mongodb is a sort of global unique identifier(guid)
https://github.com/junyugit/nobjectid
guid mongodb objectid uuid
Last synced: 5 months ago
JSON representation
objectid from mongodb is a sort of global unique identifier(guid)
- Host: GitHub
- URL: https://github.com/junyugit/nobjectid
- Owner: junyugit
- Created: 2018-01-03T05:51:40.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-25T12:11:52.000Z (over 8 years ago)
- Last Synced: 2025-09-01T17:44:47.521Z (10 months ago)
- Topics: guid, mongodb, objectid, uuid
- Language: C#
- Homepage:
- Size: 28.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nobjectid
> objectid from mongodb is a sort of global unique identifier(guid)
## use
https://www.nuget.org/packages/nobjectid
```C#
using System;
namespace Demo
{
class Program
{
static void Main(string[] args)
{
var id= ObjectId.GenerateNewId().ToString();
Console.WriteLine(id); //5a4c769ea719be0daca68075
}
}
}
```
*the generated identifier consists of 24 characters, 12 bytes, according to the rules is divided into 4 parts:
[the timestamp (4 bytes) | machine id (3 bytes) | process id (2 bytes) | increment number (3 bytes)]*
> documentation please see: http://www.mongodb.org/display/DOCS/Object+IDs