Kick name malformed
This commit is contained in:
@@ -3,6 +3,7 @@ package dbs
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
|
||||
@@ -239,6 +240,9 @@ func jsonToBsonPaths(t reflect.Type, prefix string) map[string]string {
|
||||
}
|
||||
if ft.Kind() == reflect.Struct {
|
||||
embedPrefix := strings.ToLower(ft.Name())
|
||||
re := regexp.MustCompile(`\[[^\]]*\]`)
|
||||
embedPrefix = re.ReplaceAllString(embedPrefix, "")
|
||||
embedPrefix = strings.ReplaceAll(embedPrefix, "*", "")
|
||||
if prefix != "" {
|
||||
embedPrefix = prefix + "." + embedPrefix
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user