lundi 29 mars 2021

How To update one array values to another array in mongoDB document

Can any one help me to update query Account -> details bank_name: SBI & acc_no: 98988988 to HDFC in MongoDB sub array Dynamically

{
"name": "Ravi",
"user_name": "ravirr",
"email": "ravi@gmail.com",
"accounts": [{
        "bank_name": "HDFC",
        "image": "hdfc.png",
        "details": [{
            "acc_name": "HFDC 1",
            "acc_no": "108889855",
            "status": 1,
        }, {
            "acc_name": "HFDC 1",
            "acc_no": "108889855",
            "status": 1,
        }
        ]
    }, {
        "bank_name": "SBI",
        "image": "sbi.png",
        "details": [{
            "acc_name": "SBI 1",
            "acc_no": "98988988",
            "status": 1,
        }, {
            "acc_name": "SBI 2",
            "acc_no": "8585888888",
            "status": 1,
        }
        ]
    }
    }

enter image description here

some can help to do this thanks



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire