Suppose my schema has a field containing arrays of objects, and I'd like to have endpoints for CRUD operations on these objects. From what I've seen, the idiomatic way to do things at the database level is through findByIdAndUpdate, with $push/$pull operations for adding/removing stuff.
Thing is, those calls will return the updated parent object. Generally, a POST endpoint for creating an object will return the saved object, but here there's an extra step for finding the new object in the parent object array. Is there a neat way I could achieve this or am I missing something here?
(I know having the array objects as separate entitites would solve the problem, but lets just say I cant do that)