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

C++ 下MongoDB使用

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:09:06
Original
1481 people have browsed it

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

Related labels:
Statement of this Website
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
Latest Issues
mongodb start
From 1970-01-01 08:00:00
0
0
0
linux - ubuntu14 error installing mongodb
From 1970-01-01 08:00:00
0
0
0
Use of symfony2 mongodb
From 1970-01-01 08:00:00
0
0
0
mongodb _id rename
From 1970-01-01 08:00:00
0
0
0
Parameter understanding of mongodb
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template