# Query has a different behavior if Filter is set or not?

**URL:** <https://discuss.aerospike.com/t/query-has-a-different-behavior-if-filter-is-set-or-not/5198>\
**Category:** Query & Indexing\
**Created:** [May 22, 2018, 8:57am UTC](https://discuss.aerospike.com/t/query-has-a-different-behavior-if-filter-is-set-or-not/5198 "2018-05-22T08:57:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex75](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/alex75/32/910_2.png) [@alex75](https://discuss.aerospike.com/u/alex75)\
**Post date:** [May 22, 2018, 8:57am UTC](https://discuss.aerospike.com/t/query-has-a-different-behavior-if-filter-is-set-or-not/5198/1 "2018-05-22T08:57:50Z")

</div>

Hi,

I’m using the C# driver version 3.6.3. (netstandard version)

This statement:

```
var N = 100;

var statement = new Statement
{
    Namespace = configuration.Namespace,
    SetName = configuration.MarketSetName,
    BinNames = new string[] { },
};

var recordset = Client.Query(null, statement);
while (recordset.Next() && N-- > 0)
    list.Add(recordset.Record);

```

returns N records with ALL the bins.

If I take one record and use the “Id” bin for filter it:

```
var Id = "myid"
var statement = new Statement
{
    Namespace = configuration.Namespace,
    SetName = configuration.MarketAuditSetName,
    BinNames = new string[] { },
    Filter = Filter.Equal( "Id", Id) returned!
};

var recordset = Client.Query(null, statement);
while (recordset.Next())
    list.Add(recordset.Record); 

```

I obtain NO RECORDS

In the second statement (the one where I apply a Filter) I have to pass a null collection of Bins (or not define it) to have the records!

Why the behavior of Query is different when I set the Filter ?

---

<div class="post-metadata">

**Author:** ![Brian](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/brian/32/2211_2.png) [@Brian](https://discuss.aerospike.com/u/Brian)\
**Post date:** [May 25, 2018, 11:26pm UTC](https://discuss.aerospike.com/t/query-has-a-different-behavior-if-filter-is-set-or-not/5198/2 "2018-05-25T23:26:51Z")

</div>

That is inconsistent. We will change behavior of query to return all bins if binName array is empty regardless of whether filter is defined in the next client release.
