Open
Description
Steps to reproduce
- Create an entity with an ID (ObjectId) property.
- Create another entity with an ID (ObjectId) property.
- Add a nested/sub-document property to the first entity referencing the second entity as the type; alternatively create an array of nested/sub-documents to the first entity referencing the second entity as the type.
- Create a new instance of the first entity and create and add an instance of the second entity to the first.
- Call save/create to persist to the database.
Current Behavior
- First entity will have an ObjectId automatically generated as is confirmed by inspection the record in the database.
- The child/nested/sub-document(s) (second entity) will have no ObjectId present in its ID property.
Expected Behavior
- First entity will have an ObjectId automatically generated as is confirmed by inspection the record in the database.
- The child/nested/sub-document(s) (second entity) would have an ObjectId present in its ID property that was automatically generated and should be the same for any further nested/sub-documents.
Additional information
Tested w/ 6.0.1.
I've used LB4 in several production applications so far and am a big proponent. That being said, this issue is severely hampering usage of MongoDB in real-world use cases where nested/sub-documents and nested/sub-document arrays are ever-present. Requiring workarounds by using juggler lifecycle events. Any attempt to resolve it is greatly appreciated. I also distinctly remember this working at one point and am not sure if this is a regression.