Skip to content

Commit

Permalink
Merge pull request #167 from arpando/fix/DocumentNilError
Browse files Browse the repository at this point in the history
Fix document nil error
  • Loading branch information
dhui authored Feb 5, 2019
2 parents 598addc + 56620dc commit c0f025d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion database/mongodb/mongodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c0f025d

Please sign in to comment.