Skip to content

Instantly share code, notes, and snippets.

@5idu
Created July 18, 2018 07:13
Show Gist options
  • Save 5idu/55aac8744fad9cb0257d06932856e5e5 to your computer and use it in GitHub Desktop.
Save 5idu/55aac8744fad9cb0257d06932856e5e5 to your computer and use it in GitHub Desktop.
mongodb knowledges
## $type
| Double |1|
|-|-|
| String |2|
| Object |3|
| Array |4|
|Binary data|5|
| Undefined |6|
|Object id|7|
| Boolean |8|
| Date |9|
| Null |10|
|Regular Expression|11|
| JavaScript |13|
| Symbol |14|
|JavaScript (with scope)|15|
|32-bit integer|16|
| Timestamp |17|
|64-bit integer|18|
|Min key|255|
|Max key|127|
```bash
# 如果想获取 "col" 集合中 title 为 String 的数据,你可以使用以下命令
db.col.find({"title" : {$type : 2}})
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment