I am writing a query to find and update an array in a document, but mongo shell is not responding after running the update query using $set
. The array in the document is not updated, and also no response is shown for any of the commands ran after update.
My update query looks as below,
db.TestFlowSteps.update(
{"testFlowId":"23","testRunDetail.testRunDetailId":"1"},
{$set: {'testRunDetail.$.applicationId':'5'}})
)
This is an example document:
{
"_id":ObjectId("58c92abd43df987ae87e1c79"),
"testFlowId":"23",
"testRunDetail":[
{
"testRunDetailId":"1",
"testRunId":"23",
"applicationName":"APP",
"applicationId":"41",
"testCaseId":"818",
"testCaseName":"Test123",
"browserMode":"YES",
"index":1,
"edit":false
}
]
}