Add support for some mongodb 4.0 features, but only at an experimental stage.
add func:
// UpdateWithArrayFilters allows passing an array of filter documents that determines
// which array elements to modify for an update operation on an array field. The multi parameter
// determines whether the update should update multiple documents (true) or only one document (false).
//
// See example: https://docs.mongodb.com/manual/reference/method/db.collection.update/#update-arrayfiltersi
//
// Note this method is only compatible with MongoDB 3.6+.
func (c *Collection) UpdateWithArrayFilters(selector, update, arrayFilters interface{}, multi bool) (*ChangeInfo, error)
A sub-package that implements the BSON specification is also included, and may be used independently of the driver.
mgo
is known to work well on (and has integration tests against) MongoDB v3.0, 3.2, 3.4, 3.6 and 4.0 .