Why updateOrCreateMany not delete old data? #3897
Unanswered
positivedeveloper36
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
My code like this :
This is a one to many relation
The result of
files
like this :If I run the code, it successfully updates the old data, but it doesn't work to delete old data
So, I have 3 data in the table of database. If I remove 1 data and I run the query and I check the table, the data is 3. It should be two
For example I remove
"fileName": "1662319086345_test1.pdf"
. Should the new data to be like this :How can I solve this problem?
Please help. Thanks
Note :
I follow this docs : https://docs.adonisjs.com/reference/orm/relations/has-many#updateorcreatemany
Beta Was this translation helpful? Give feedback.
All reactions