More specifically, the following changes were performed in this
release:
- Way to pronounce the project name defined! ;-) It's pronounced
as _mango_ (not mmmmgo, not em-go).
- The FindAndModify command was integrated into the Query
type, via the Modify method. This example, for instance, sets N to
42 and returns its previous value:
change := mgo.Change{Update: M{"n": 42}}
err = col.Find(M{"_id": id}).Modify(change, &doc)
fmt.Println(doc.N)
More details may be found in the documentation:
http://goneat.org/lp/mgo#Query.Modify
- Update and UpdateAll will now return mgo.NotFound when no
documents are updated. See the documentation for details:
http://goneat.org/lp/mgo#Collection.Update
http://goneat.org/lp/mgo#Collection.UpdateAll
- Upsert now returns the inserted id when the document is
not found for updating:
http://goneat.org/lp/mgo#Collection.Upsert
--
Gustavo Niemeyer
http://niemeyer.net
http://niemeyer.net/blog
http://niemeyer.net/twitter