title: Mongoose: Recursive embedded-document in Coffeescript
body: <p>Based on <a href="https://github.com/LearnBoost/mongoose/blob/master/examples/schema.js" rel="nofollow">this example</a> (which works):</p>
  
  <pre><code>var Comment = new Schema();
  
  Comment.add({
      title : { type: String, index: true }
    , date : Date
    , body : String
    , comments : [Comment]
  });
  </code></pre>
  
  <p>I wanted to create a CoffeeScript version</p>
  
  <pre><code>mongoose = require 'mongoose'
  Schema = mongoose.Schema
  
  Person = new Schema
  Person.add
    mother: Person
    father: Person
  </code></pre>
  
  <p>However it returns an error and I don't understand why</p>
  
  <pre><code>TypeError: undefined is not a function
      at CALL_NON_FUNCTION_AS_CONSTRUCTOR (native)
      at Function.interpretAsType (/path/node_modules/mongoose/lib/schema.js:202:10)
      at Schema.path (/path/node_modules/mongoose/lib/schema.js:162:29)
      at Schema.add (/path/node_modules/mongoose/lib/schema.js:110:12)
      at Object.&lt;anonymous&gt; (/path/Models/test.coffee:6:10)
      at Object.&lt;anonymous&gt; (/path/Models/test.coffee:10:4)
      at Module._compile (module.js:411:26)
      at Object.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script.js:57:25)
      at /usr/local/lib/node_modules/coffee-script/lib/command.js:147:29
      at /usr/local/lib/node_modules/coffee-script/lib/command.js:115:26
  </code></pre>
  
  <p>EDIT: Okay, I found out that it doesn't work when Person isn't an array (in brackets), but why?</p>