I read the source of the mongoose, find this code in https://github.com/LearnBoost/mongoose/blob/master/lib/collection.js#L23 :
/** * The collection name * * @api public */ Collection.prototype.name;
I do not understand why this line exists. Is it here just for document generation?
Yes.
This helps everyone who reads the code to know that this property is for public access and helps the doc generator signal the same way.