Created
March 30, 2016 15:16
-
-
Save AtnNn/465776232240c8f5748a59f45102c23c to your computer and use it in GitHub Desktop.
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
#include "rethinkdb.h" | |
int main() { | |
try { | |
std::unique_ptr<RethinkDB::Connection> conn = RethinkDB::connect("localhost", 28015); | |
RethinkDB::Cursor cursor = RethinkDB::table("leaderboard").order_by("score").limit(2).run(*conn); | |
for (auto score = cursor.begin(); score != cursor.end(); ++score) { | |
printf("datum: %s\n", RethinkDB::write_datum(*score).c_str()); | |
} | |
} catch (RethinkDB::Error &err) { | |
printf("error: %s\n", err.message.c_str()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment