Created
July 4, 2017 13:26
-
-
Save neilsarkar/84d8f614c9653884cb233c13b1656108 to your computer and use it in GitHub Desktop.
example poop.js
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
process.env.__base = __dirname | |
const User = require(process.env.__base + '/models/userModel'); | |
User.findOrCreate({ | |
where: { | |
facebook_id: 1, | |
}, | |
defaults: { | |
name: Math.random(), | |
}, | |
}).spread((user, created) => { | |
console.log('user', user.toJSON(), 'found', !created) | |
}).catch((err) => { | |
console.error('nope', err) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment