小编joa*_*ves的帖子

MongoDB null字段或true/false

在MongoDB上,当我们有"草稿"(是/否),"已发布"(是/否)等字段时,这是最好的策略吗?在所有记录中创建字段并输入"是"/"否"值或将字段放在哪里?

posts: [{_id:1, text:"hello", draft:true},{_id:2 text:"world", draft:false}]
Run Code Online (Sandbox Code Playgroud)

要么

posts: [{_id:1, text:"hello", draft:true},{_id:2 text:"world"}]
Run Code Online (Sandbox Code Playgroud)

哪个更快?它适用于大量数据.

最好的问候,João

mongodb

8
推荐指数
1
解决办法
1万
查看次数

标签 统计

mongodb ×1