速读摘要文章源自JAVA秀-https://www.javaxiu.com/19244.html
[C++共享全局变量而不使用外部变量的最佳方法?20如何鼓励C程序中未定义的行为/乱序执行?31具有非聚合列的此cassandra查询的已定义行为是什么?文章源自JAVA秀-https://www.javaxiu.com/19244.html
原文约 1734 字 | 图片 0 张 | 建议阅读 4 分钟 | 评价反馈文章源自JAVA秀-https://www.javaxiu.com/19244.html
如何以正确的geoJSON格式存储
问题描述投票:0回答:1
我正在尝试按以下方式以geoJSON格式存储一些数据。文章源自JAVA秀-https://www.javaxiu.com/19244.html
var newUser = { 'username': $('#addUser fieldset input#inputUserName').val(), 'location': {type: "Point", coordinates: [ $('#addUser fieldset input#inputUserLocationLng').val(), $('#addUser fieldset input#inputUserLocationLat').val()]}, 'email': $('#addUser fieldset input#inputUserEmail').val(), 'phone': $('#addUser fieldset input#inputUserPhone').val(), 'chat': $('#addUser fieldset select#inputChatAllowed').val() }
并且如下所示保存。文章源自JAVA秀-https://www.javaxiu.com/19244.html
{ "_id" : ObjectId("5e327c7b8c0181090e15d445"), "username" : "test2", "location[type]" : "Point", "location[coordinates][]" : [ 77.641145, 12.89149 ], "email" : "test2@gmail.com", "phone" : "8998778987", "chat" : "0" }
但是我希望位置部分采用经过验证的here和正确的geoJSON格式,如下所示。文章源自JAVA秀-https://www.javaxiu.com/19244.html
"location": { "type" : "Point", "coordinates" : [ -73.856077, 40.848447 ] }
我正在使用猫鼬和nodejs。任何建议都会有所帮助。文章源自JAVA秀-https://www.javaxiu.com/19244.html
mongodbgeospatialgeojsonmongoose-schema文章源自JAVA秀-https://www.javaxiu.com/19244.html
1个回答
1投票文章源自JAVA秀-https://www.javaxiu.com/19244.html
该文档看起来很奇怪。也许这是一种解决方法:文章源自JAVA秀-https://www.javaxiu.com/19244.html
doc = db.col.insertOne({ "username": "test2", "email": "test2@gmail.com", "phone": "8998778987", "chat": "0" }) db.col.updateOne( { _id: doc.insertedId }, { $set: { "location.type": "Point" } } ) db.col.updateOne( { _id: doc.insertedId }, { $push: { "location.coordinates": { $each: [-73.856077, 40.848447] } } } )
或文章源自JAVA秀-https://www.javaxiu.com/19244.html
db.col.updateOne( { _id: doc.insertedId }, { $push: { "location.coordinates": -73.856077 } } ) db.col.updateOne( { _id: doc.insertedId }, { $push: { "location.coordinates": 40.848447 } } )
结果:文章源自JAVA秀-https://www.javaxiu.com/19244.html
{ "_id" : ObjectId("5e32eb3405a39c3341179e7f"), "username" : "test2", "email" : "test2@gmail.com", "phone" : "8998778987", "chat" : "0", "location" : { "type" : "Point", "coordinates" : [ -73.856077, 40.848447 ] } }
文章源自JAVA秀-https://www.javaxiu.com/19244.html热门问题
LevelDB:如何从其leveldb中读取Skype8的会话文章源自JAVA秀-https://www.javaxiu.com/19244.html
我可以“看到”Java标准库脱机吗?文章源自JAVA秀-https://www.javaxiu.com/19244.html
Dart:获取通用List类型的子类型文章源自JAVA秀-https://www.javaxiu.com/19244.html
如何在CentOS上解决Vysor的插件问题文章源自JAVA秀-https://www.javaxiu.com/19244.html
sed删除以单引号开头的行文章源自JAVA秀-https://www.javaxiu.com/19244.html
Python Pandas:向不同len的df添加列表文章源自JAVA秀-https://www.javaxiu.com/19244.html
返回数组javascript中的两个最高数字文章源自JAVA秀-https://www.javaxiu.com/19244.html
Iam尝试跳出FPS播放器,但提示错误文章源自JAVA秀-https://www.javaxiu.com/19244.html
蜻蜓设置原始文件名文章源自JAVA秀-https://www.javaxiu.com/19244.html
减法表不起作用。我减去其他所有元素文章源自JAVA秀-https://www.javaxiu.com/19244.html
每当我在父组件中满足显示子组件的条件时,如何在子组件中执行一个函数?文章源自JAVA秀-https://www.javaxiu.com/19244.html
有没有办法忽略perl中的非线程安全模块?文章源自JAVA秀-https://www.javaxiu.com/19244.html
Bootstrap 3.2.0 glyphicons未显示文章源自JAVA秀-https://www.javaxiu.com/19244.html
如何使用Python修改Discord webhook的频道文章源自JAVA秀-https://www.javaxiu.com/19244.html
AngularJS DOM更新了将元素添加到$ scope但不删除文章源自JAVA秀-https://www.javaxiu.com/19244.html
如何使Pino库成为通用库并在项目中的任何地方调用文章源自JAVA秀-https://www.javaxiu.com/19244.html
[C ++共享全局变量而不使用外部变量的最佳方法?文章源自JAVA秀-https://www.javaxiu.com/19244.html
Powershell在pgp解密时失败了文章源自JAVA秀-https://www.javaxiu.com/19244.html
ajax发送FormData c#WebMethod文章源自JAVA秀-https://www.javaxiu.com/19244.html
[Microsoft.Typescript未被Microsoft.NET.Sdk.Web.ProjectSystem导入文章源自JAVA秀-https://www.javaxiu.com/19244.html
推荐问题
- 1AVR ATmega在主循环之前使用printf时保持重置
- 2我如何按一列对整个熊猫数据框进行排序,移动以3s分组的行
- 3request.exceptions.MissingSchema:无效的网址
- 4选择排序与LINQ,偏序
- 5如何使用fragmentstateadapter(viewpager2)创建的碎片被销毁
- 6将数字终端输入读取到数组中并对数组进行排序[Bash]
- 7XSLT创建具有相同ID和名称的多个记录
- 8如何使用Angular上的ngbDatePicker插件禁用过去的日期
- 9CriteriaBuilder API。 IN子句查询
- 10Spring JDBC出站网关返回原始有效载荷。
- 11更新OroCRM帐户时插入数据
- 12休眠实体类的构造函数
- 13无法在Android上使用正确的google-services.json文件接收FCM推送通知
- 14如何在角度对象中访问动态命名属性?
- 15正在与多次使用同一组件共享数据
- 16全局const优化和符号插入
- 17名称'spark'未定义
- 18如何将数字作为表格引用?
- 19。net core LaunchSettings json在项目名称中设置为生产模式,但以开发模式输入
- 20如何鼓励C程序中未定义的行为/乱序执行?
- 21文件同步Visual Studio 2015错误
- 22秒表计算(将00:00转换为00:00 C#
- 23多消费者在DPDK框架中出局
- 24快速而又脏的方法,确保一次只运行一个shell脚本实例
- 25限制用户仅输入英文文本输入,无其他语言响应本机
- 26如何使用pickBy方法传递值数组以进行过滤
- 27Keycloak getAccessToken在Java Eclipse / Maven项目中有效,但抛出通过命令行运行的ProcessingException
- 28通过Visual Studio中C#中的datagridview更新SQL Server数据库
- 29无法同时使用Spring MVC在HTML中同时正确打印ArrayList和表单
- 30如何在此Prolog谓词中获得句号?
- 31具有非聚合列的此cassandra查询的已定义行为是什么?
- 32我如何获得在Yahoo Finance中使用的外汇报价器?
- 33C中循环链表中的显示功能
- 34在java中有什么“@Override”?
- 35[DAX查找不相关表中的第一个非空白值
- 36例外:布局必须是破折号组件或返回破折号组件的函数
- 37无法发布多个文件
- 38Savitzky-Golay导数,使用SciPy的信号计算。savgol_filter是否需要缩放?
- 39Nuxt:使用NuxtJS服务器中间件修改来自代理服务器的响应
- 40python3-当父类位于单独的文件中时,子类不继承父方法
最新问题
- 内嵌块导致的空白[重复]
- 如何在Mongoose中让空值排在最后?
- 我无法访问列表元素
- Bixby:想重定向到网页浏览器的网址上的按钮点击
- HANA XSA中Fiori发射板中的动态瓦片。如何?
- 允许用户在使用angular firebase与google注册时,选择用哪个邮箱注册。
- 为什么我的iframe把html内容当作文本?
- .NET OAuthAuthorizationServerProvider多条登录路径。
- 如何找出当前在 OS X 下运行的 Mono 应用程序?
- 不能用哈希密码登录 - Mysqli PHP
- 将相同的键组合在一个数组中并打印在smarty中。
- 从C++中提取QT QML模型--地图渲染的问题
- 从网站上获取数据到Python的
- 我如何在一个方法中使用已经创建的对象到另一个方法中?
- Early termination of worker puma log是什么意思,为什么会发生这种情况?
- Java过滤器不能返回布尔值[重复]。
- 应用捆绑如何影响应用更新大小
- 反应路由器用字符串代替param
- Rails content_tag vs tag
- 如何在HTML中获取内容<ol> 用python从URL中获取内容。

评论