Question: Im trying to figure out how to Post a search object to mongo, and find all documents that matches one or more properties stated in the search object. 

eg if i have post a json object as this: 

```
// searchObject
{
  "kind": "employee"
  "name": "casper",
  "email": "daniel@mail.com"
}

```

i want to get all documents that contains `"name": "casper"`or `"email":"daniel@mail.com"`or both from the employee collection. 

this is what i have so far. but i dont know how to loop through my properties. 

```
router.post('/search', async (ctx) => {
  const searchObject = Object.assign(ctx.request.body);
  const collection = searchObject.kind

  const result = await store[collection].find({
    $and: [{ searchObject }]
  })
  console.log('result', result)
})

```

Answer: 
You can filter only when length is desired length or more, if it's less return an empty array therefore clearing the list:

```
filterSkills() {
    this.filterCars = this.search.length > 2 ? this.cars.filter(car => 
    car.name.toLowerCase().includes(this.search.toLowerCase())) : [];
}

```
```
hey you can do onething,

```

```
 **onInputChange(text) {
   if (*here you can put the condition if text has atleset 3 alphabets like this.search.length>3*) {
       filteredData = this.options[0].data.filter(item => {
     return item.name.toLowerCase().indexOf(text.toLowerCase()) > -1;
    }).slice(0, this.limit);
   }**

```