当前位置:网站首页>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边栏推荐
- sql server数据库添加 mdf数据库文件,遇到的报错
- Introduction to cron expression
- C语言初阶-指针详解-庖丁解牛篇
- How to implement append in tensor
- 你真的懂继电器吗?
- Source code analysis | layout file loading process
- 迅雷chrome扩展插件造成服务器返回的数据js解析页面数据异常
- Deep Reinforcement Learning for Intelligent Transportation Systems: A Survey 论文阅读笔记
- random shuffle注意
- Can netstat still play like this?
猜你喜欢

xiaodi-笔记

Add automatic model generation function to hade

Build a private cloud disk cloudrev

Basic operation of binary tree (C language version)

Practice of traffic recording and playback in vivo
![[fluent] JSON model conversion (JSON serialization tool | JSON manual serialization | writing dart model classes according to JSON | online automatic conversion of dart classes according to JSON)](/img/6a/ae44ddb090ce6373f04a550a15f973.jpg)
[fluent] JSON model conversion (JSON serialization tool | JSON manual serialization | writing dart model classes according to JSON | online automatic conversion of dart classes according to JSON)

函数栈帧的创建与销毁

Super easy to use logzero
![[shutter] banner carousel component (shutter_wiper plug-in | swiper component)](/img/a6/5c97ef3f34702b83ebf0511501d757.gif)
[shutter] banner carousel component (shutter_wiper plug-in | swiper component)

Check log4j problems using stain analysis
随机推荐
Add MDF database file to SQL Server database, and the error is reported
Deep Reinforcement Learning for Intelligent Transportation Systems: A Survey 论文阅读笔记
I2C 子系统(四):I2C debug
Summary of interview project technology stack
Deep reinforcement learning for intelligent transportation systems: a survey paper reading notes
【富瀚6630编码存录像,用rtsp服务器及时间戳同步实现vlc观看录像】
Gbase 8C system table PG_ class
Counter统计数量后,如何返回有序的key
Didi programmers are despised by relatives: an annual salary of 800000 is not as good as two teachers
Cancer biopsy instruments and kits - market status and future development trends
Basic operation of binary tree (C language version)
ASP. Net core 6 framework unveiling example demonstration [02]: application development based on routing, MVC and grpc
Gbase 8C trigger (I)
Kubernetes cluster log and efk architecture log scheme
Classes and objects - initialization and cleanup of objects - constructor call rules
超好用的日志库 logzero
yii2 中andWhere多个or查询 orm条件
Gbase 8C create user / role example 2
Two dimensional format array format index subscript continuity problem leads to return JSON format problem
Gbase 8C system table PG_ amproc