Hi,
I've an object with an array of schemas.
e.g.
Address= new Schema(
Line 1: String
)
Person = new Schema(
Addresses: [Address]
)
I have a case where I want to clone the last address and add it to the Addresses array.
addr = _.clone(_.last(p.Addresses))
p.Addresses.push(addr)
p.save(...)
but I'm getting the error below when I try to save.
TypeError: Object function toString() { [native code] } has no method 'cast'"
Is there a better way to do this in mongoose?
Thanks,
Chris