当前位置:网站首页>The data obtained from mongodb query data command is null
The data obtained from mongodb query data command is null
2022-06-13 04:14:00 【Day t】
When we use node.js obtain mongodb When the data is inside , Obtained data is empty
as follows :
home.get("/idioms-find", async(req,res) => {
// Receive the current page parameters passed by the client
let value = req.query.val || 1;
let idioms = await Idiom.find({
'word':value });
res.send({
rows:idioms,
});
});
When the value I passed from the client is " Look in all directions " When
Back to idioms Empty array , puzzled , Most bloggers say it's because mongodb hold collection The value of a set becomes a complex number , Is, indeed, , However, there is no error in the current data acquisition , In other words, you define the database as idiom, The database will indeed become idioms


But add s, Or the obtained data is empty
Directly in the database , Can find data 


So remove the leading and trailing spaces

You can get the data
边栏推荐
- JS common array methods
- How can a sweeping robot avoid obstacles without "mental retardation"? Analysis of five mainstream obstacle avoidance techniques
- Single chip microcomputer: infrared remote control communication principle
- Call C function in Lua
- Koa file upload and download
- [note]vs2015 compilation of masm32 using MASM32 Library
- Principle, composition and functions of sensors of Dajiang UAV flight control system
- Lambda end operation find and match allmatch
- 【自动化测试】关于unittest你需要知道的事
- Understand the pseudo static configuration to solve the 404 problem of refreshing the page of the deployment project
猜你喜欢

Single chip microcomputer: infrared remote control communication principle

R: Employee turnover forecast practice
![[test development] advanced part - Classification of various test technologies](/img/39/aa79bf798bece478752091592a8a8b.png)
[test development] advanced part - Classification of various test technologies

EIA map making - data processing + map making

手机私有充电协议解读

USB-IF BC1.2充电协议解读
![[kubernetes series] pod chapter actual operation](/img/ac/fb563f3d92e6fdbd36e41d2f213556.jpg)
[kubernetes series] pod chapter actual operation

单片机外设介绍:温度传感器 DS18B20

1.4.2 Capital Market Theroy

Introduction and use of ES6
随机推荐
单片机:A/D 和 D/A 的基本概念
Principle and control program of single chip microcomputer serial port communication
Sword finger offer II 022 Entry node of a link in a linked list
Lambda end operation count
[test development] advanced part - Classification of various test technologies
单片机:PCF8591硬件接口
Answer private message @ Tiantian Wx //2022-6-12 C language 51 single chip microcomputer led analog traffic light
Lambda termination operation find and match anymatch
Line height equals height why not center
Manage PC startup items
JSTL -- JSP standard tag library
Redis数据持久化
Goframe day 5
Forgotten fleeting years
[test development] automated test selenium (II) -- common APIs for webdriver
ET框架-22 创建ServerInfo实体及事件
Redis hyperloglog cardinality statistics algorithm
单片机:A/D(模数转换)的主要指标
Zoom and move the H5 part of the mobile end
EGO Planner代码解析----CMakeLists.txt和package.xml