0
我想遠程項目只包含空格" "
我怎麼能刪除2級深度嵌套數組的一些項目
但我的查詢不起作用,任何建議
查詢
db[source_collection].update({
'_id': customer._id
}, {
'$pull': {
"records.0.items": {
$regex: /^\s*$/
}
}
});
文獻
{
"_id" : "025daee4b9b9ba36ed244bb594313ff9",
"records" : [
{
"items" : [
"7089 "
]
},
{
"items" : [
" ",
"78059"
]
},
{
"items" : [
" ",
"5645 "
]
}
]
}
嗨@yogesh我會稍後再嘗試,非常感謝。它需要我有一段時間來弄清楚。 – newBike