diff --git a/mongo/collection.go b/mongo/collection.go index 99e3b711ae3b7481d88082e922a6baaa12c4a46d..fdd7685e7d6f3750d0d87c7694d5f8368bacc3d8 100644 --- a/mongo/collection.go +++ b/mongo/collection.go @@ -263,7 +263,8 @@ func (col *Collection) Exists() bool { // Fetches object _id or generates a new one if object doesn't have one or the one it has is invalid func getID(item interface{}) interface{} { - v := reflect.ValueOf(item) + v := reflect.ValueOf(item) // convert interface to Value + v = reflect.Indirect(v) // convert pointers switch v.Kind() { case reflect.Map: