Skip to content

Instantly share code, notes, and snippets.

@majormunky
Created May 13, 2021 15:59
Show Gist options
  • Save majormunky/1137a7034e90206c98b3d395902c1aaf to your computer and use it in GitHub Desktop.
Save majormunky/1137a7034e90206c98b3d395902c1aaf to your computer and use it in GitHub Desktop.
Rethink db query
r = require('rethinkdb')
const server = {host: "localhost", port: 28015};
async function run() {
let authors = await get_authors();
console.log(authors)
}
async function get_authors() {
let conn = await r.connect(server);
let cursor = await r.table("authors").run(conn);
let results = await cursor.toArray();
return results;
}
run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment