[SERVER-28703] Unable to $Pull array by 2nd element in array Created: 08/Apr/17  Updated: 10/Apr/17  Resolved: 10/Apr/17

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Question Priority: Major - P3
Reporter: Suman Chakraborty Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File students.json    
Participants:

 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 }
)



 Comments   
Comment by Kelsey Schubert [ 10/Apr/17 ]

Thanks for the update, tataiermail. I'm closing this ticket per your request.

Comment by Suman Chakraborty [ 09/Apr/17 ]

Please close it, it was due to RoboMongo IDE rounding off a float.

Not a Defect.

Comment by Suman Chakraborty [ 08/Apr/17 ]

version 3.4.2, on windows 8 64 bit

Generated at Thu Feb 08 04:18:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.