Adding field in Mongoose plugin gives "TypeError: Invalid value for schema path `CreatedBy.type`"
Well, you won't believe it, but I solved it by adding the CreatedBy
field this way
schema.add CreatedBy: ref: "account" type: mongoose.Schema.Types.ObjectId
Yes, by just exchanging the 2 lines for ref
& type
!! . It is weird how exchanging these 2 lines could break the code :| !!!