# getItems

### `getItems({key: value, ...} , (data)=> {}, (error)=> {})`

## How to use:

```jsx
my_collection.getItems(
    {key: value},
    (data) =>  // data array can access here,
    (error) => alert(error) 
);
```

## Arguments:

| parameter        | required | types    |
| ---------------- | -------- | -------- |
| search object    | yes      | object   |
| success callback | yes      | function |
| failure callback | yes      | function |

## Example:

```jsx
import React,{useEffect} from 'react';
import {Text} from 'react-native';
import {Pleex} from 'pleex';

const App = () => {
  
  // Create collection
  const my_collection = Pleex.collection('myCollection');
  
  // Get all data saved
  my_collection.getItems(
    { age: 12 },
    (data) =>  // data array can access here,
    (error) => alert(error) 
  );
  
  return (
    <>
      <Text>Try getItems api</Text>
    </>
  );

};

export default App;
```

## Tips:

1. if pleex don't find anything its return **\[ ], empty array**
