Created
May 13, 2021 15:59
-
-
Save majormunky/1137a7034e90206c98b3d395902c1aaf to your computer and use it in GitHub Desktop.
Rethink db query
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
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