How to use $cond in mongoDB
Please refer the attached image and help me explain this case. Why didn't cova_items column assigned value of InStock column when woo_order_id is null? query command: db.cova_order.aggregate([ { $project:{ InStock:1, woo_order_id:1, woo_order_data:1, cova_items:{ $cond: { if: { $eq:["$woo_order_id",null] }, then:"$InStock"…