I believe the difference between the two ways you've presented is related to the difference between Subdocuments and nested paths as explained in the official doc: Subdocuments versus Nested Paths
Comparing to the examples given, 'author' is not a Subdocuments of the 'Posts', it's a property defined in the Schema, therefore, the correct syntax, as presented in the official doc Document.prototype.get(), is to pass the path as a string (as the first way you typed):
doc.get(path,[type],[options])
- path ?String?
- [type] ?Schema|String|Number|Buffer|*? optionally specify a type for on-the-fly attributes
- [options] ?Object?
- [options.virtuals=false] ?Boolean? Apply virtuals before getting this path
- [options.getters=true] ?Boolean? If false, skip applying getters and just get the raw value
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…