还是太无知了,node语法还有这种操作
let where = {
"$and": [{
"d.ecid": "fddca08888888888888888"
},
{
"d.bill_item_status": 1
}
]
}
let params1 = { where };
var caseWhere = params1.where['$and']
caseWhere.push({ '$express': ' b.type=1' })
console.log(JSON.stringify(caseWhere, null, "\t"))
console.log('------------------------------------------------------------------------')
console.log(JSON.stringify(params1, null, "\t"))
输出
[
{
"d.ecid": "fddca08888888888888888"
},
{
"d.bill_item_status": 1
},
{
"$express": " b.type=1"
}
]
------------------------------------------------------------------------
{
"where": {
"$and": [
{
"d.ecid": "fddca08888888888888888"
},
{
"d.bill_item_status": 1
},
{
"$express": " b.type=1"
}
]
}
}