Skip to content

Instantly share code, notes, and snippets.

@bloudermilk
Created September 22, 2011 19:19
Show Gist options
  • Save bloudermilk/1235737 to your computer and use it in GitHub Desktop.
Save bloudermilk/1235737 to your computer and use it in GitHub Desktop.
CoffeseSript + Mongoose
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