In the end, it really comes down to personal choices and what works best for your application.
The only requirement that MongoDB imposes on _id is that it is unique. It can be an ObjectId (which is provided by default), a string, even an embedded document (as I recall, it cannot be an Array).
In this case, you can probably guarantee that the ISO code is a unique value and can be an ideal value. You have a โknownโ primary key, which is also useful in itself, being identifiable, so using this instead of the generated identifier is probably a more reasonable bet. It also means that you refer to this information in another collection, you can save the ISO code instead of the object identifier; Those who view your raw data can immediately determine what information this point refers to.
Aside:
The two great advantages of ObjectId are that they can be created uniquely on multiple machines, processes, and threads, without requiring any kind of central sequence tracking on the MongoDB server. They are also stored as a special type in MongoDB, which uses only 12 bytes (as opposed to the 24-byte representation of the string version of ObjectID)
Brendan W. McAdams
source share