From e188579048285381a7e444d0a9f4c2b59026a1e0 Mon Sep 17 00:00:00 2001 From: Kazuki Date: Sat, 11 Mar 2023 05:17:25 -0800 Subject: [PATCH 1/2] doc(datastore): Add document around FitlerField --- datastore/query.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/datastore/query.go b/datastore/query.go index 195ae102bbf5..f0426f25192c 100644 --- a/datastore/query.go +++ b/datastore/query.go @@ -208,6 +208,8 @@ func (q *Query) Filter(filterStr string, value interface{}) *Query { // Field names which contain spaces, quote marks, or operator characters // should be passed as quoted Go string literals as returned by strconv.Quote // or the fmt package's %q verb. +// For "in" and "not-in" operator, use []interface{} as value. For instance +// query.FilterField("Month", "in", []interface{1, 2, 3, 4}) func (q *Query) FilterField(fieldName, operator string, value interface{}) *Query { q = q.clone() From e08ca6dca67e4076e06acada1ee648e2f82f17a3 Mon Sep 17 00:00:00 2001 From: Kazuki Date: Wed, 14 Jun 2023 14:22:06 -0700 Subject: [PATCH 2/2] Update datastore/query.go Co-authored-by: Baha Aiman --- datastore/query.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datastore/query.go b/datastore/query.go index f0426f25192c..3090353cf0b8 100644 --- a/datastore/query.go +++ b/datastore/query.go @@ -209,7 +209,7 @@ func (q *Query) Filter(filterStr string, value interface{}) *Query { // should be passed as quoted Go string literals as returned by strconv.Quote // or the fmt package's %q verb. // For "in" and "not-in" operator, use []interface{} as value. For instance -// query.FilterField("Month", "in", []interface{1, 2, 3, 4}) +// query.FilterField("Month", "in", []interface{}{1, 2, 3, 4}) func (q *Query) FilterField(fieldName, operator string, value interface{}) *Query { q = q.clone()