Skip to content

Instantly share code, notes, and snippets.

View gist:6c4a6da7a6f2e297170b
bsoncxx::builder::stream::document doc;
doc << “mykey” << “myvalue”
<< “mynum” << 1;
optional<result::insert_one> res = col.insert_one(doc);
View gist:cbfc96d3f9ab924a9776
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
<?php
$c = (new MongoClient())->demo->points;
$c->find( [
'loc' => [
'$geoWithin' => [
'type' => 'Polygon',
'coordinates' => [ [
[ -0.91, 51.74 ],
[ -0.91, 51.27 ],
View gist:6a0f5511b2b362556bf0
<?php
$c = (new MongoClient())->demo->points;
$c->find( [
'loc' => [
'$geoWithin' => [
'type' => 'Polygon',
'coordinates' => [ [
[ -0.91, 51.74 ],
[ -0.91, 51.27 ],