From 3924fca2896c1a02bae096bb5903f23526ed6e23 Mon Sep 17 00:00:00 2001 From: mr Date: Tue, 2 Jun 2026 10:50:42 +0200 Subject: [PATCH] Kick name malformed --- dbs/dbs.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dbs/dbs.go b/dbs/dbs.go index 29d3163..003a771 100644 --- a/dbs/dbs.go +++ b/dbs/dbs.go @@ -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 }