1

Can the _id of an old deleted MongoDB document reappear/regenerate for a future document in the same collection as the old _id is not in the picture because the associated document was deleted?

Vishal Kumar
  • 65
  • 3
  • 7

1 Answers1

1

Please find this answer: Possibility of duplicate Mongo ObjectId's being generated in two different collections?

As it states the BSON Object ID is partially based on "seconds since epoch" so it seems it should not be regenerated at different time.

poleszcz
  • 145
  • 9
  • Thanks, it looks like they are highly unlikely to be same for different collections so it should be good for the same collection, not able to figure out a case where it might regenerate again within the same collection considering it is not present anymore. – Vishal Kumar Sep 07 '21 at 07:01