当前位置:网站首页>Update and return document in mongodb - update and return document in mongodb
Update and return document in mongodb - update and return document in mongodb
2022-07-03 02:51:00 【Bustling city 】
problem :
I want to get updated documents. I want to get updated files .This is my original code and it successfully updates but doesn't return the document. This is my original code , It updates successfully but does not return documents .
collection.update({ "code": req.body.code },{$set: req.body.updatedFields}, function(err, results) { res.send({error: err, affected: results}); db.close(); });I used the toArray function, but this gave the error "Cannot use a writeConcern without a provided callback": I use the toArray function , But this gives the wrong “ If there is no callback provided , Can't use writeConcern”:
collection.update({ "code": req.body.code },{$set: req.body.updatedFields}).toArray( function(err, results) { res.send({error: err, affected: results}); db.close(); });Any ideas? Do you have any ideas ?
Solution :
Reference resources : https://stackoom.com/en/question/1fpsD边栏推荐
- Linear rectification function relu and its variants in deep learning activation function
- Didi programmers are despised by relatives: an annual salary of 800000 is not as good as two teachers
- What is the way out for children from poor families?
- 【翻译】具有集中控制平面的现代应用负载平衡
- 《MATLAB 神经网络43个案例分析》:第43章 神经网络高效编程技巧——基于MATLAB R2012b新版本特性的探讨
- The Linux server needs to install the agent software EPS (agent) database
- 左值右指解释的比较好的
- sql server 查询指定表的表结构
- SqlServer行转列PIVOT
- [shutter] setup of shutter development environment (supplement the latest information | the latest installation tutorial on August 25, 2021)
猜你喜欢

【翻译】具有集中控制平面的现代应用负载平衡

C language beginner level - pointer explanation - paoding jieniu chapter

Pytest (6) -fixture (Firmware)

"Analysis of 43 cases of MATLAB neural network": Chapter 43 efficient programming skills of neural network -- Discussion Based on the characteristics of the new version of MATLAB r2012b

Three.js本地环境搭建

《MATLAB 神经网络43个案例分析》:第43章 神经网络高效编程技巧——基于MATLAB R2012b新版本特性的探讨

【翻译】后台项目加入了CNCF孵化器

Kubernetes cluster log and efk architecture log scheme

vfork执行时出现Segmentation fault

I2C 子系统(二):I3C spec
随机推荐
用docker 连接mysql的过程
Check log4j problems using stain analysis
Practice of traffic recording and playback in vivo
Hcip137-147 title + analysis
Simple understanding of SVG
错误Invalid bound statement (not found): com.ruoyi.stock.mapper.StockDetailMapper.xxxx解决
处理数据集,使用LabelEncoder将所有id转换为从0开始
tensor中的append应该如何实现
Gbase 8C system table PG_ attribute
怎么将yolov5中的PANet层改为BiFPN
How to change the panet layer in yolov5 to bifpn
Cron表达式介绍
random shuffle注意
C language beginner level - pointer explanation - paoding jieniu chapter
What does it mean when lambda is not entered?
Super easy to use logzero
"Analysis of 43 cases of MATLAB neural network": Chapter 43 efficient programming skills of neural network -- Discussion Based on the characteristics of the new version of MATLAB r2012b
Joking about Domain Driven Design (III) -- Dilemma
面试项目技术栈总结
Deep learning: multi-layer perceptron and XOR problem (pytoch Implementation)