Created
September 22, 2011 19:19
-
-
Save bloudermilk/1235737 to your computer and use it in GitHub Desktop.
CoffeseSript + Mongoose
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
BootModel = Mongoose.model "Boot", new Schema | |
laces: Number | |
tied: Boolean | |
class Boot extends BootModel | |
boot = new Boot | |
boot.laces = 4 | |
boot.tied = true | |
# Works fine | |
boot.save (err) -> throw err if err? | |
# Throws error | |
# 12:12:04 crawler.1 | TypeError: Object function Boot() { | |
# 12:12:04 crawler.1 | Boot.__super__.constructor.apply(this, arguments); | |
# 12:12:04 crawler.1 | } has no method 'find' | |
Boot.find {}, (err, docs) -> | |
console.log err, docs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment