I can’t seem to find a way to push elements into a nested array. I’ve tried exploring the MongoDB documentation along with surfing stack-overflow and yet I can’t find a solution. My schema look like this:
This works and I can successfully create this and retrieve data such as the funds, wallet, bank etc. However I’m struggling to set value.
One instance that I am working on now is trying to push elements to the “employees” array inside of “company.”
I have the object that I want to push and whatever attempt I try, whether it be a code snippet from stack-overflow or trying to make something myself from the documentation.
Any code snippets or advice to overcome this would be greatly appreciated.