I am using Mongoose + CoffeeScript and when I try to add embedded documents to my Schema, the code is wrongly converted.
e.g:
AccountSchema = new Schema # Companhia
name : String
users : [UserSchema]
custphones : [CustphoneSchema]
becomes
AccountSchema = new Schema({
name: String({
users: [UserSchema],
custphones: [CustphoneSchema]
})
});
and should have become
AccountSchema = new Schema({
name: String,
users: [UserSchema],
custphones: [CustphoneSchema]
});
Why is this happening?
Thanks
Did you check that the indentations are consistent in their use of tabs and spaces? This is a common problem when whitespace is part of the syntax.
To get your your particular (broken) output, you probably indented with tab on
name, and spaces onusersandcustphones.