javascript - MongoDB多维数组
问题描述
我对整个多维更新 Longs 和 Lats 有问题,我不确定如何允许使用用户提交的内容更新当前数据。注意:我试过环顾四周,这些例子仍然不起作用
Route.updateOne({ _id: Ids, 'Routes.Waypoints.Latitude': Lat, 'Routes.Waypoints:Longitude': Long }, { $set: {Routes:{Waypoints:{Latitude: NewLat, Longitude: NewLong }}}}, { new: true },
function (err, UpdatePoints) {
if (err) console.error(err);
if (UpdatePoints) {
console.log(UpdatePoints)
}
})
})
解决方案
推荐阅读
- react-native - React Native - Animated.View 内的可触摸不透明度是背景列表视图的触发事件
- c# - 跨线程操作在后台工作者 c# 中无效
- sql-server - 对远程服务器的访问被拒绝,因为不存在登录映射。(Microsoft SQL Server,错误:7416)
- spring-data-jpa - 阴影 jar 无法找到 XML 模式命名空间的 Spring NamespaceHandler [http://www.springframework.org/schema/data/jpa]
- android - 如何在我的游戏循环中获得预期的动作顺序?
- c++ - 为什么 unordered_multimap 没有 lower_bound 和 upper_bound?
- python - 使用 word2vec / wordnet 的两个列表之间的余弦相似度
- html - 前台导航 - 基于引导类和自定义 js
- excel - 使用任务计划程序从 PowerShell 创建电子邮件(运行时错误 429)
- reactjs - 如何测试 Firebase signInWithEmailAndPassword?