[toc]
## pre
創建一個Schema時,我們能通過`new mongoose.Schema`的第二個參數——配置對象,來為我們的Schema添加配置
```
const UserSchema = new mongoose.Schema(define, {timestamps: true});
```
## timestamps
自動添加時間戳
```
const UserSchema = new mongoose.Schema(define, {timestamps: true});
```
## collection
如果你指定Schema的時候指定了`collection`的值,那么會使用這個值作為集合的名字
,否則就是模型名轉小寫再轉復數 -> User-user-users
```
const UserSchema = new mongoose.Schema(define, {collection:'user'});
```