mongodb - Mgo pull update not working -
I'm trying to achieve the following functionality with Emoji Library:
db Artists.update ({_id: ObjectId ( "534944125117082b30000001"}}, {$ bridge: {study: {_id: ObjectId ( "53d53591718a522e04000001")}}})
this is basically a Update in the collection of artists, where I am trying to remove a study related to the field of study, based on its ID.
So I use these:
pullQuery: = & amp; Bson.m {" Dhyyn ": & amp; bson.M {" _ id ": bson.ObjectIdHex (" 53d53fd6718a521954000001 ")}} err = col.Update (& amp; bson.M {" _ id ":" 534944125117082b30000001 "}, & amp ;; Bson.m { "$ bridge" Pulclaiti})
but it does not seem to work. If I run earlier versions directly Robomongo (Mongodb client utility) it is working fine, but with Mjio, it does not seem to work
err = col.UpdateId (bson.ObjectIdHex ( "534944125117082b30000001"), & amp; bson.M { "$ pull": pullQuery})
Your first $ Pull
in the example ObjectId
does not match the code that you are actually using _id
s?
Comments
Post a Comment