When i delete a particular card from card collection its not deleted from that user’s array how to solve this i want that the a particular card be flushed out of whole db including the user’s array which contains that card
I haven’t tried any query i used went to atlas to delete a particular card from card table just to check if the same card is also deleted from array within user’s card
As I can see in your schema, there is only one parent users schema, and cards is an array that is sub schema, so there should be one collection users, how cards is a different collection?
Your question is still not clear to me, if you want to delete elements from cards then you can use update methods (updateOne, updateMany) query with $pull operator and positional operators ($ positional, and $[<identifier>] positional filtered).
You can also share a link to the playground for anything you need help with.
Pd: remember that Cards is not a collection, it is just a shape for the elements in the array. I wonder if you are trying to store a reference to a different collection instead.
Well when i ran my code i’ve sent above two tables were created(sorry i dont know terminologies that well i’m more familiar with SQL terms) and this is what i have tried in atlas i expect the card inside user’s array to be deleted as well but it is still there
here’s what i tried in atlas @santimir