There is a model - Post
(using mongoose
var Post = new Schema({...});
).
And every time new instance of Post
model is created (var post = new Post({...}); post.save(function (error) {...});
), the instance is given with an item, called: _id
(ObjectId("...")
).
I know it might be a stupid question, but: as much as database gets larger and larger, is there a limited amount _id
or is it infinite?
Asked
Active
Viewed 51 times
1

Ramziddin Makhmudov
- 114
- 2
- 9
-
1Possible duplicate of [Possibility of duplicate Mongo ObjectId's being generated in two different collections?](http://stackoverflow.com/questions/4677237/possibility-of-duplicate-mongo-objectids-being-generated-in-two-different-colle) – SlashmanX Dec 08 '15 at 10:28
1 Answers
3
There is no "limit" because the value is comprised partially of "a 4-byte value representing the seconds since the Unix epoch"
See this link: https://docs.mongodb.org/manual/reference/object-id/

Matt Evans
- 7,113
- 7
- 32
- 64