# Filter and logical operators: how many filters per query does Aerospike support?

**URL:** <https://discuss.aerospike.com/t/filter-and-logical-operators-how-many-filters-per-query-does-aerospike-support/2121>\
**Category:** Go Client\
**Created:** [November 12, 2015, 11:17am UTC](https://discuss.aerospike.com/t/filter-and-logical-operators-how-many-filters-per-query-does-aerospike-support/2121 "2015-11-12T11:17:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oleg222](https://avatars.discourse-cdn.com/v4/letter/o/b782af/32.png) [@Oleg222](https://discuss.aerospike.com/u/Oleg222)\
**Post date:** [November 12, 2015, 11:17am UTC](https://discuss.aerospike.com/t/filter-and-logical-operators-how-many-filters-per-query-does-aerospike-support/2121/1 "2015-11-12T11:17:55Z")

</div>

```
stmt := as.NewStatement("asd", "asd")    
stmt.Addfilter(as.NewEqualFilter("Name", ""))
stmt.Addfilter(as.NewEqualFilter("Name", "string"))

```

This code will search Name = “” || “string” or Name = “” && “string”?  
How search Bin Name which contain “” or “string”?  
Thanks.

---

<div class="post-metadata">

**Author:** ![Khosrow\_Afroozeh](https://avatars.discourse-cdn.com/v4/letter/k/c6cbf5/32.png) [@Khosrow\_Afroozeh](https://discuss.aerospike.com/u/Khosrow_Afroozeh)\
**Post date:** [November 12, 2015, 11:29am UTC](https://discuss.aerospike.com/t/filter-and-logical-operators-how-many-filters-per-query-does-aerospike-support/2121/2 "2015-11-12T11:29:44Z")

</div>

At the moment, only one filter is supported by Aerospike Server per query.

---

<div class="post-metadata">

**Author:** ![Oleg222](https://avatars.discourse-cdn.com/v4/letter/o/b782af/32.png) [@Oleg222](https://discuss.aerospike.com/u/Oleg222)\
**Post date:** [November 12, 2015, 11:38am UTC](https://discuss.aerospike.com/t/filter-and-logical-operators-how-many-filters-per-query-does-aerospike-support/2121/3 "2015-11-12T11:38:25Z")

</div>

Only one Bid name or only one filter?

```
stmt.Addfilter(as.NewEqualFilter("Name1", "string1"))
stmt.Addfilter(as.NewEqualFilter("Name2", "string2"))

```

Not work?

---

<div class="post-metadata">

**Author:** ![manigandham](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/manigandham/32/58_2.png) [@manigandham](https://discuss.aerospike.com/u/manigandham)\
**Post date:** [November 14, 2015, 9:13am UTC](https://discuss.aerospike.com/t/filter-and-logical-operators-how-many-filters-per-query-does-aerospike-support/2121/4 "2015-11-14T09:13:39Z")

</div>

No that won’t work.

Only a single filter is allowed through the driver, you have to use a UDF if you want to filter on more properties.

---

<div class="post-metadata">

**Author:** ![GeertJohan](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/geertjohan/32/483_2.png) [@GeertJohan](https://discuss.aerospike.com/u/GeertJohan)\
**Post date:** [November 30, 2015, 11:07pm UTC](https://discuss.aerospike.com/t/filter-and-logical-operators-how-many-filters-per-query-does-aerospike-support/2121/5 "2015-11-30T23:07:41Z")

</div>

Maybe this should return an error or even panic client-side, when trying to add a second filter?

Also, documentation could be improved. `AddFilter` kind of implies that multiple filters can be added. Just opened a PR for that ([Add warning about setting multiple filters per statement by GeertJohan · Pull Request #98 · aerospike/aerospike-client-go · GitHub](https://github.com/aerospike/aerospike-client-go/pull/98)).
