Skip to content

Commit 1db3333

Browse files
Merge pull request #1415 from redis/DOC-5102-go-countonly-search-example
DOC-5102 added Go CountOnly search example
2 parents 71a2ec2 + 00945bd commit 1db3333

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

content/develop/clients/go/queryjson.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@ Specify query options to return only the `city` field:
102102
{{< clients-example go_home_json query2 >}}
103103
{{< /clients-example >}}
104104

105+
You can also use the same query with the `CountOnly` option
106+
enabled to get the number of documents found without
107+
returning the documents themselves.
108+
109+
{{< clients-example go_home_json query2count_only >}}
110+
{{< /clients-example >}}
111+
105112
Use an
106113
[aggregation query]({{< relref "/develop/interact/search-and-query/query/aggregation" >}})
107114
to count all users in each city.

0 commit comments

Comments
 (0)