SchemaType.set() Parameters Returns: Example: SchemaType.set() Parameters option «String» The name of the option you’d like to set (e.g. trim, lowercase, etc…) value «...
Connection.prototype.client Type: Connection.prototype.client Type: «property» The MongoClient instance this connection uses to talk to MongoDB. Mongoose automatically se...
Connection.prototype.plugins Type: Example: Connection.prototype.plugins Type: «property» The plugins that will be applied to all models created on this connection. E...
模型(Model) Models are fancy constructors compiled from our Schema definitions. Instances of these models represent documents which can be saved and retrieved from our database. Al...
Connection.prototype.setClient() Returns: Example: Connection.prototype.setClient() Returns: «Connection» this Set the MongoDB driver MongoClient instance that this co...
SchemaType.cast() Parameters Returns: Example: SchemaType.cast() Parameters caster «Function|false» Function that casts arbitrary values to this type, or throws an error...
Document.prototype.$isEmpty() Returns: Example: Document.prototype.$isEmpty() Returns: «Boolean» Returns true if the given path is nullish or only contains empty objects...
文章的增删改查 文章模型设计 文章发表 文章列表与详情 文章编辑与删除 文章的增删改查 这节我们来实现一个文章相关功能: 发表文章 GET posts/new POST posts/new 文章详情 GET posts/:id 修改文章 GET posts/:id/edit POST posts/:id/edit 删除文...