node.js - Mongoose 不更新文档
问题描述
我尝试到处搜索,但总是出错或没有任何改变。这是我的代码:
Blog.findOneAndUpdate({title: "Lol"}, {$push: {details:"detail"}})
.then(function(){
console.log("Data updated");
}).catch(function(error){
console.log(error);
});
如果有人能给我建议,我会很高兴的。我仍然需要从文档中删除并添加/更新文档。
(对不起英文...谷歌翻译)
解决方案
推荐阅读
- reactjs - 如何在不重复安装和卸载的情况下实现 useEffect?
- php - 为什么抛出异常“未定义的变量”?
- mysql - Google Cloud SQL 的 API 基本网址
- limit - 您可以对 promQL 查询应用限制吗?
- oracle - Oracle apex 更改默认列首选项/设置
- python - Python3 输入和 mypy 的意外可选行为
- prometheus - 使用外部普罗米修斯的 Zeebe 指标监控
- python - Django-将 DateField 模型条目更新为默认字符串
- .net - .NET 5 Blazor 服务器 ServiceStack 模板
- angular - mat-datepicker 反应式表单在表单重置时设置默认值