I have a collection in Mongodb I’m accessing in my app and connecting through ReactJS and mongoose. On this collection I have a property that is set to an Array type. When I add to that Array, it does so successfully, however I DO NOT see an _id field that should be automatically be created. Why would this be happening? Thanks.
>Solution :
Id fields are only added to top-level-documents, not to sub-documents in arrays. If you want to have ids on the sub-documents, you need to add them to your schema manually when saving.