|
|
@ -2,6 +2,7 @@ package common |
|
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
import ( |
|
|
|
"github.com/mainnika/mongox-go-driver/mongox" |
|
|
|
"github.com/mainnika/mongox-go-driver/mongox" |
|
|
|
|
|
|
|
"github.com/mainnika/mongox-go-driver/mongox/base" |
|
|
|
"github.com/mainnika/mongox-go-driver/mongox/errors" |
|
|
|
"github.com/mainnika/mongox-go-driver/mongox/errors" |
|
|
|
"github.com/mainnika/mongox-go-driver/mongox/query" |
|
|
|
"github.com/mainnika/mongox-go-driver/mongox/query" |
|
|
|
"go.mongodb.org/mongo-driver/mongo" |
|
|
|
"go.mongodb.org/mongo-driver/mongo" |
|
|
@ -30,5 +31,7 @@ func LoadOne(db *mongox.Database, target interface{}, filters ...interface{}) er |
|
|
|
return errors.NotFoundErrorf("can't find result: %s", result.Err()) |
|
|
|
return errors.NotFoundErrorf("can't find result: %s", result.Err()) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
base.Reset(target) |
|
|
|
|
|
|
|
|
|
|
|
return result.Decode(target) |
|
|
|
return result.Decode(target) |
|
|
|
} |
|
|
|
} |
|
|
|