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 ], |
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 ], |
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; | |
} |
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); |