Skip to content

Instantly share code, notes, and snippets.

@gabidavila
Created July 18, 2018 19:24
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 gabidavila/3d808fa37ef296aade839ceb139dfd68 to your computer and use it in GitHub Desktop.
Save gabidavila/3d808fa37ef296aade839ceb139dfd68 to your computer and use it in GitHub Desktop.
const mysqlx = require('@mysql/xdevapi');
const options = require('./config')
mysqlx.getSession(options)
.then((session) => {
const db = session.getSchema("worldcup");
let teamsCollection = db.getCollection("teams_2018");
return teamsCollection.find("name = :country1 OR name = :country2")
.bind("country1", "Brazil")
.bind("country2", "England")
.execute(console.log)
})
.catch(err => {
console.log(err.stack);
process.exit(1);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment