This commit is contained in:
Kamil Dziedzic
2017-09-04 15:53:37 +02:00
parent f0396cc8d6
commit 6fa8dc5161

View File

@@ -142,7 +142,7 @@ func (self ExampleQuery) ExplainCmd() bson.D {
for i := range cmd {
// drop $db param as it is not supported in MongoDB 3.0
if cmd[i].Name == "$db" {
if len(cmd) - 1 == i {
if len(cmd)-1 == i {
cmd = cmd[:i]
} else {
cmd = append(cmd[:i], cmd[i+1:]...)