Model.where({}).update().exec() not updating
See original GitHub issueTried
yield Model
.where('myId'),equals(id)
.update({a:'1'})
.exec()
and
yield Model
.where({'myId':id})
.update({a:'1'})
.exec()
both returns
{ok:0,n:0,nModified:0}
However, the following works
yield Model.update(query,update,options).exec()
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Updated query inside EXEC not updating data? - Stack Overflow
I have used the "FROM USER U" in update query, But output generated by PRINT(@DynamicSql) if i copy and execute directly it executes...
Read more >Pre update hook not updating field correctly #3549 - GitHub
Hey @willemmulder, only issue I can find with your code in #964 is that hashSync() takes 2 arguments re bcrypt docs. Other than...
Read more >Update Data - UPDATE - SQLModel
Hey SQL database , I want to UPDATE the table called hero . ... Let's not forget to add that update_heroes() function to...
Read more >UPDATE (Transact-SQL) - SQL Server - Microsoft Learn
When a FILESTREAM field is set to NULL, the BLOB data associated with the field is deleted. You cannot use .WRITE(), to perform...
Read more >Updating Documents in Mongoose - Mastering JS
Using Model.updateOne() and Model.updateMany() , you can update the document without loading it from the database first. In the below example, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Try
Off the top of my head I don’t think Model even has a
where()
function, that’s on the query builder…Yep the chained version should work in theory. I’ll investigate.