From 56620dc3dd7fcdbc72d3201891f96fe12f6e5200 Mon Sep 17 00:00:00 2001 From: Arcadio Pando Date: Fri, 1 Feb 2019 16:25:24 +0100 Subject: [PATCH] Fix document nil error --- database/mongodb/mongodb.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/mongodb/mongodb.go b/database/mongodb/mongodb.go index 356228e..58e152e 100644 --- a/database/mongodb/mongodb.go +++ b/database/mongodb/mongodb.go @@ -118,7 +118,7 @@ func (m *Mongo) SetVersion(version int, dirty bool) error { func (m *Mongo) Version() (version int, dirty bool, err error) { var versionInfo versionInfo - err = m.db.Collection(m.config.MigrationsCollection).FindOne(context.TODO(), nil).Decode(&versionInfo) + err = m.db.Collection(m.config.MigrationsCollection).FindOne(context.TODO(), bson.M{}).Decode(&versionInfo) switch { case err == mongo.ErrNoDocuments: return database.NilVersion, false, nil