The easiest way to describe this feature is by providing a syntactical example:
const company = new Company({
email: 'famous@company.com',
employees: [
new Employee({ name: 'John Doe' }), // New Employee
new Employee({ id: 6 }, false), // Existing Employee
],
});
await company.save();
The code above should insert a new Company to the database, but before that, the new Employee (first in the array) shall be stored. Related object trees should be stored recursively, in an order defined by the relations of the referenced objects.
The easiest way to describe this feature is by providing a syntactical example:
The code above should insert a new Company to the database, but before that, the new Employee (first in the array) shall be stored. Related object trees should be stored recursively, in an order defined by the relations of the referenced objects.