在每个mongodb$cond中,1和0的作用是什么?

在每个mongodb$cond中,1和0的作用是什么?,mongodb,mongoose,Mongodb,Mongoose,mngo db中最后一个$cond中1,0的含义是什么?第4行 single_registration: { $cond: [ { $and: [ { $gte: [ "$registration_created", startDateFirst ] }, { $lte:[ "$registration_created", endDateFirst ] } ] }, 1, 0 ] }, 数组内容的定义是“if,then,else”。所以这里说“如果这个条件是

mngo db中最后一个$cond中1,0的含义是什么?第4行

single_registration: { $cond: [
     { $and: [
     { $gte: [ "$registration_created", startDateFirst ] },
     { $lte:[ "$registration_created", endDateFirst ] }
   ] }, 1, 0
] },
数组内容的定义是“if,then,else”。所以这里说“如果这个条件是真的,那么是1,否则是0。”