Details
-
Question
-
Resolution: Done
-
Major - P3
-
None
-
None
-
None
-
None
Description
Students Json attached herewith has been imported into students collection, has 200 documents.
When trying to delete single array element from and array by second element (score),
shell gives message: Updated 1 existing record(s) in 1ms
But actually no change happens inside db and the array element stays there.
Below commands not working:
db.students.update(
|
{ '_id': 0 },
|
{ $pull: { scores: { type: 'homework', score: 6.67617606065462 } } },
|
{ multi: true }
|
)
|
db.students.update(
|
{ '_id': 0 },
|
{ $pull: { scores: { type: "homework",score:6.67617606065462} } },
|
{ multi: true }
|
)
|
|
|
But, below command works when trying to delete by 1st element of the array
|
db.students.update(
|
{ '_id': 0 },
|
{ $pull: { scores: { type: 'homework' } } },
|
{ multi: true }
|
)
|