getenv
conn[][]
string mongoConnect=std::string(getenv("MONGODB_URI"));
MONGODB_URL
CROW_ROUTE(app, "/contacts") ([&collection]() { mongocxx::options::find opts; opts.limit(10); auto docs=collection.find({}, opts); std::ostringstream os; for (auto&& doc : docs) { os<<bsoncxx::to_json(doc)<<endl; } return crow::response(os.str()); });
mongocxx::instance inst{};string mongoConnect=std::string(getenv("MONGODB_URI"));mongocxx::client conn{mongocxx::uri{mongoConnect}};auto collection=conn["containers-us-west-175.railway.app:7978"]["contacts"];