我是mongoDB的新手,需要查询才能删除集合

我有两个收藏。

1.设备

    db.getCollection("Equipment").find({ 
    $and: [
        { $where: 'this._id.length <= 7' },
        { "model": "A505"}
    ]})


{
    "_id" : "1234567",
    "locationId" : "DATALOAD",
    "model" : "A505",
    "subscriberId" : "",
    "status" : "Stock",
    "headendNumber" : "4"
}

{
    "_id" : "P13050I",
    "locationId" : "1423110302801",
    "model" : "A505",
    "subscriberId" : "37",
    "status" : "Stock",
    "headendNumber" : "4"
}

我将获得100多个文档(行)设备集合。

2.订阅者

db.getCollection('Subscriber').find({})

{
    "_id" : "5622351",
    "equipment" : [ 
        "0018015094E6", 
        "1234567", 
        "ADFB70878422", 
        "M10610TCB052", 
        "MA1113FHQ151"
    ]
}

{
    "_id" : "490001508063",
    "equipment" : [ 
        "17616644510288", 
        "P13050I", 
        "M91416EA4251", 
        "128552270280560"
    ]
}

在订户集合中,我只需要删除(匹配设备集合循环中的所有ID)匹配设备字段。 从以上结果中得出的外汇,我只需要删除“ 1234567”和“ P13050I”

预期的输出。

db.getCollection('Subscriber').find({})

{
    "_id" : "5622351",
    "equipment" : [ 
        "0018015094E6", 

        "ADFB70878422", 
        "M10610TCB052", 
        "MA1113FHQ151"
    ]
}

{
    "_id" : "490001508063",
    "equipment" : [ 
        "17616644510288", 

        "M91416EA4251", 
        "128552270280560"
    ]
}

任何人都请帮助我。