Created
April 18, 2016 21:09
-
-
Save jayjanssen/e6b309218cc452cb8df5fc9bd78b851d to your computer and use it in GitHub Desktop.
mysqlx with iced coffeescript
This file contains hidden or 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
#!/usr/bin/env iced | |
mysqlx = require('mysqlx') | |
# Connect to server on localhost | |
await mysqlx.getSession { | |
host: 'mysql57.docker', port: '33060', | |
dbUser: 'root', dbPassword: 'root' | |
} | |
.then defer session | |
# Specify with document to find with Collection.find() and | |
# fetch it from the database with .execute() | |
await session.getSchema('world_x').getCollection('CountryInfo').find().limit(1).execute defer document | |
console.log document | |
session.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment