# mongoose中一些常用的查询语句

* 或查询语句

  student.findOne(){

  $or:\[{},{}]

  }
*

:warning:在使&#x7528;**\_id**索引字段作为查询字段时报错了，可恶困扰了我好久

```javascript
Cast to ObjectId failed for value "111" at path "_id" for model "Student"
```

当集合中不存在对应的\_id值时，mongoose查询语句将会报错，可能这个键是系统自动创建的吧
