diff --git a/dri/mongodb/mongodb.go b/dri/mongodb/mongodb.go index 42c5238..437301f 100644 --- a/dri/mongodb/mongodb.go +++ b/dri/mongodb/mongodb.go @@ -86,7 +86,11 @@ func (that *mongoDb) Get(table string, where Map) Map { that.LastErr = err return nil } - return results[0] + if len(results) > 0 { + + return results[0] + } + return nil } func (that mongoDb) Select(table string, where Map, page, pageRow int64) []Map {