mirror of
https://github.com/status-im/migrate.git
synced 2025-02-23 08:18:07 +00:00
Fix document nil error
This commit is contained in:
parent
5ad19c5071
commit
56620dc3dd
@ -118,7 +118,7 @@ func (m *Mongo) SetVersion(version int, dirty bool) error {
|
|||||||
|
|
||||||
func (m *Mongo) Version() (version int, dirty bool, err error) {
|
func (m *Mongo) Version() (version int, dirty bool, err error) {
|
||||||
var versionInfo versionInfo
|
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 {
|
switch {
|
||||||
case err == mongo.ErrNoDocuments:
|
case err == mongo.ErrNoDocuments:
|
||||||
return database.NilVersion, false, nil
|
return database.NilVersion, false, nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user