Home >Database >Mysql Tutorial >C++ 下MongoDB使用

C++ 下MongoDB使用

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 17:09:061480browse

C++ 下MongoDB使用: 增加字段{$set:{字段:1}})删除字段{$unset:{字段:1}}) 查询数组中的元素{关键字:{$all:[位置,其他

C++ 下MongoDB使用:

增加字段
{$set:{"字段":1}})
删除字段
{$unset:{"字段":1}})

查询数组中的元素
{"关键字":{$all:["位置","其他"]}}

增加数组元素(重复的不会加)
{"$addToSet":{"关键字":{"$each":["位置","其他"]}}}


经纬度查询(经度在前,纬度在后)
从近到远排序
{"经纬度":{"$near":[28.0988562,109.3167951]}}

以座标为中心(经度,纬度,距离)
{"地址信息.经纬度":{"$within":{"$center":[[28.0988562,109.3167951],0.1]}}}

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn