当前位置:网站首页>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边栏推荐
- 【翻译】后台项目加入了CNCF孵化器
- Interview stereotyped version
- The solution of "the required function is not supported" in win10 remote desktop connection is to modify the Registry [easy to understand]
- 一文带你了解 ZigBee
- Your family must be very poor if you fight like this!
- Kubernetes family container housekeeper pod online Q & A?
- Gbase 8C function / stored procedure definition
- [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)
- Counter统计数量后,如何返回有序的key
- The process of connecting MySQL with docker
猜你喜欢

Privatization lightweight continuous integration deployment scheme -- 01 environment configuration (Part 2)

Le processus de connexion mysql avec docker

Random Shuffle attention

Pytest (6) -fixture (Firmware)

I2C 子系统(一):I2C spec

超好用的日志库 logzero

The process of connecting MySQL with docker

Kubernetes family container housekeeper pod online Q & A?
![[principles of multithreading and high concurrency: 1_cpu multi-level cache model]](/img/7e/ad9ea78868126b149bd9f15f587e6c.jpg)
[principles of multithreading and high concurrency: 1_cpu multi-level cache model]

错误Invalid bound statement (not found): com.ruoyi.stock.mapper.StockDetailMapper.xxxx解决
随机推荐
How to implement append in tensor
Joking about Domain Driven Design (III) -- Dilemma
Introduction to cron expression
Gbase 8C system table PG_ am
Gbase 8C function / stored procedure parameters (II)
Unity3d human skin real time rendering real simulated human skin real time rendering "suggestions collection"
Check log4j problems using stain analysis
Xiaodi notes
leetcode540
Three.js本地环境搭建
函数栈帧的创建与销毁
JMeter performance test JDBC request (query database to obtain database data) use "suggestions collection"
Gbase 8C system table PG_ amop
Basic operation of binary tree (C language version)
As a leader, how to control the code version and demand development when the epidemic comes| Community essay solicitation
Summary of interview project technology stack
Sqlserver row to column pivot
C语言中左值和右值的区别
HW-初始准备
HTB-Devel