View gist:6c4a6da7a6f2e297170b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bsoncxx::builder::stream::document doc; | |
doc << “mykey” << “myvalue” | |
<< “mynum” << 1; | |
optional<result::insert_one> res = col.insert_one(doc); |
View gist:cbfc96d3f9ab924a9776
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mongocxx::driver::client c{“mongo://example.com:27017”}; | |
auto col = c[“testdb”][“testcol”]; | |
for (auto doc : col.find({}) { | |
std::cout << bsoncxx::to_json(doc) << std::endl; | |
} |
View gist:9da9505374d2287ecb89
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$c = (new MongoClient())->demo->points; | |
$c->find( [ | |
'loc' => [ | |
'$geoWithin' => [ | |
'type' => 'Polygon', | |
'coordinates' => [ [ | |
[ -0.91, 51.74 ], | |
[ -0.91, 51.27 ], |
View gist:6a0f5511b2b362556bf0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$c = (new MongoClient())->demo->points; | |
$c->find( [ | |
'loc' => [ | |
'$geoWithin' => [ | |
'type' => 'Polygon', | |
'coordinates' => [ [ | |
[ -0.91, 51.74 ], | |
[ -0.91, 51.27 ], |