Closed dryutsun closed 2 years ago
Are you having troubles with the mongoose code on the backend or are you having a hard time sending it from react? If it's back-end, just do a forEach through the array and push one at a time?
My Understanding Thus Far:
Is that more or less what you are suggesting?
oh so creating new subdocuments is actually a POST, not a PATCH. I'm gonna come chat with you.
Goro is going to separate the 'add new items' (POST) from the 'edit this order'(Patch) and report back if he hits another block doing that.
Solution:
What stack are you using?
(ex: MERN(mongoose + react), DR(django + react), PEN, etc.)
MERN
What's the problem you're trying to solve?
Instead of having the user submit a single subdcoument array item at a time, I would like them to be able to submit an array of updates without any conflict.
Post any code you think might be relevant (one fenced block per file)
If you see an error message, post it here. If you don't, what unexpected behavior are you seeing?
This is a question about approach/implementation not about actual issue.
What is your best guess as to the source of the problem?
What things have you already tried to solve the problem?
I've attempted to push in an array payload which does not work. Either there is a built-in native mongoose method or...?