Skip to content

Instantly share code, notes, and snippets.

@jayjanssen
Created April 18, 2016 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jayjanssen/e6b309218cc452cb8df5fc9bd78b851d to your computer and use it in GitHub Desktop.
Save jayjanssen/e6b309218cc452cb8df5fc9bd78b851d to your computer and use it in GitHub Desktop.
mysqlx with iced coffeescript
#!/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