mongoose (mongodb) Alias _id field
mongodb, mongoose
Solution
You would use a virtual attribute for that. As in:
yourSchema.virtual('ID').get(function() { return this._id; });
Problem
Is it possible with mongoose use a different name, in my case uppercase 'ID', as an alias for the schema _id field? Would I need to add a virtual or is there another way of setting this up? Any help gratefully received thanks.