I am confused on finding a way to convert this mongo shell query to Laravel (using jenssegers).
Here is the collection I have: test
{
"_id" : ObjectId("5d84b2b27ef856d9e55eef67"),
"workflow" : [
{
"basic_details" : {
"wfCode" : "wf1"
},
"stages" : [
{
"stage_id" : "wf1_1",
"stage_code" : "submission",
"stage_name" : "Submission",
"button_label" : "submit"
},
{
"stage_id" : "wf1_2",
"stage_code" : "s2",
"stage_name" : "S2",
"button_label" : "label2"
}
]
}
]
}
and my update query is:
db.getCollection('test').update(
{ _id : ObjectId("5d84b2b27ef856d9e55eef67") },
{ $set:
{
"workflow.$[i].stages.$[j].stage_code" : "edit",
"workflow.$[i].stages.$[j].stage_name" : "Editing"
}
},
{ arrayFilters : [ { "i.basic_details.wfCode": 'wf1' },{ "j.stage_id" : "wf1_2" } ] } )
How can I convert this query, so that I can run it from Laraval jenseggers.