int main(int, char**) { mongocxx::instance inst{}; mongocxx::client conn{mongocxx::uri{}}; bsoncxx::builder::stream::document document{}; auto collection = conn["testdb"]["testcollection"]; document << "hello" << "world"; collection.insert_one(document.view()); auto cursor = collection.find({}); for (auto&& doc : cursor) { std::cout << bsoncxx::to_json(doc) << std::endl; } }
int load_axes(SceneObject *scene_object) { auto renderable = get_axes_renderable(&color_direct); insert_one(scene_object, renderable, color_direct); return 0; }
Renderable *load_points(SceneObject *scene_object, int n_points) { auto renderable = get_points_renderable(&points, n_points); return insert_one(scene_object, renderable, points); }
Renderable *load_line(SceneObject *scene_object) { auto renderable = get_line_renderable(&points); return insert_one(scene_object, renderable, points); }
void ping_store::insert_tbl(acl::db_handle& db) { std::vector<host_status*>::const_iterator cit = host_list_->begin(); for (; cit != host_list_->end(); ++cit) insert_one(db, *cit); }
void dns_store::insert_tbl(acl::db_handle& db) { std::vector<domain_info*>::const_iterator cit = domain_list_->begin(); for (; cit != domain_list_->end(); ++cit) insert_one(db, *cit); }