Skip to content

Commit 20e77d8

Browse files
committed
Fix bug QueryBuilder
1 parent 6adf017 commit 20e77d8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

query/query_builder.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ func Build(sm interface{}, modelType reflect.Type, tableName string) (dynamodb.S
5353
ps = true
5454
psv = *s0
5555
}
56+
field = field.Elem()
57+
kind = field.Kind()
5658
}
5759
s0, ok0 := x.(string)
5860
if ok0 {
@@ -61,6 +63,7 @@ func Build(sm interface{}, modelType reflect.Type, tableName string) (dynamodb.S
6163
}
6264
psv = s0
6365
}
66+
ks := kind.String()
6467
if v, ok := x.(*search.Filter); ok {
6568
if v.Excluding != nil && len(v.Excluding) > 0 {
6669
if _, _, name, ok := getFieldByBson(modelType, "_id"); ok {
@@ -77,7 +80,7 @@ func Build(sm interface{}, modelType reflect.Type, tableName string) (dynamodb.S
7780
}
7881
}
7982
continue
80-
} else if ps || kind == reflect.String {
83+
} else if ps || ks == "string" {
8184
if _, name, ok := d.GetFieldByName(modelType, value.Type().Field(i).Name); ok {
8285
var condition expression.ConditionBuilder
8386
if !field.IsNil() {

0 commit comments

Comments
 (0)