创建查询以在对象数组中查找对象[重复]
Posted
技术标签:
?????????????????????[??]??????:Create query to find an object in array of objects [duplicate] ??????:2019-08-23 21:24:41 ??????:??????“?? x ??”????????“??”????“??”?? x ??
???????????????????
read(req, res)
const id= req.params.id;
data.find(id: id).then((data) =>
res.send(data);
)
????????????????????
????:
const UserSchema = new Schema(
users : [
id : String,
name : String,
others : [
location : x : [String], y : [String]
]
]
)
?????“bob”????????? x ??:
???????
"id" : 1,
"name" : "bob",
"others": [
"location" : "x" : ["here" : "london", "somewhere" : "home"], "y" : ["here" : "london", "somewhere" : "home"]
]
?????:
"x" : [
"here" : "london",
"somewhere" : "home"
]
??????:
?????????? ??????? Quastion ??????,????????????“x”?? ?????1?:????????select?
????:
以上是关于创建查询以在对象数组中查找对象[重复]的主要内容,如果未能解决你的问题,请参考以下文章
序列化对象以在 JavaScript/jQuery 中查询字符串 [重复]
Postgresql:搜索jsonb对象数组时如何使用动态值?