I have a mongodb query and I want to update the action to denied for Sale which meets <some random invoice number>

孤街醉人 提交于 2020-05-17 08:47:04

问题


I have a mongodb query and I want to update the action to denied for Sale which meets

I want to update the action to denied.

I have tried several other methods but still it is not working.

Here is my json:

{

"Sales" : [ 
    {  
        "InvoiceNumber" : "Temp-ObjectID(\"5e9cb6c6ad4f2a0ef06ae159\")",
        "Action" : [ 
            "Approved"
        ],
        "Log" : [ 
            "Created on: 04/20/2020 42:04:04"
        ]
    }, 
    {

        "InvoiceNumber" : "Temp-ObjectID(\"5e9cbe20287628f1cbf78fdb\")",
        "Action" : [ 
            "Approve", 
            "Decline", 
            "Edit", 
            "Remarks"
        ],
        "Log" : [ 
            "Created on: 04/20/2020 42:04:04"
        ]
    }, 
    {
        "InvoiceNumber" : "Temp-ObjectID(\"5e9df32ffbcd19d39250c6e8\")",
        "Action" : [ 
            "Approve", 
            "Decline", 
            "Edit", 
            "Remarks"
        ],
        "Log" : [ 
            "Created on: 04/21/2020 412:04:04"
        ]
    }, 
    {

        "InvoiceNumber" : "Temp-ObjectID(\"5e9df3bb41034effca69f86e\")",
        "Action" : [ 
            "Approve", 
            "Decline", 
            "Edit", 
            "Remarks"
        ],
        "Log" : [ 
            "Created on: 04/21/2020 412:04:04"
        ]
    }, 
    {

        "InvoiceNumber" : "Temp-ObjectID(\"5ea173752b1baad5dfdf4023\")",
        "Action" : [ 
            "Approve", 
            "Decline", 
            "Edit", 
            "Remarks"
        ],
        "Log" : [ 
            "Created on: 04/23/2020 44:04:04"
        ]
    }
]

}

I want to update the action to denied. I want to use array filter in it and do that.

来源:https://stackoverflow.com/questions/61424264/i-have-a-mongodb-query-and-i-want-to-update-the-action-to-denied-for-sale-which

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!