> For the complete documentation index, see [llms.txt](https://pleex.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pleex.gitbook.io/docs/insertmultiple.md).

# insertMultiple

### `insertMultipe({data}, schema, (success)=> {}, (error)=> {})`

## How to use:

```jsx
my_collection.insertMultiple(
    [
        {key: value},
        {key: value}
    ],
    schema,
    () =>  // removed successfully,
    (error) => alert(error) 
);
```

## Arguments:

| parameter        | required | types            |
| ---------------- | -------- | ---------------- |
| data (input)     | yes      | array of objects |
| schema           | yes      | schema variable  |
| 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');
  
  // Create schema
  const my_schema = Pleex.schema({
    name: String,
  });

  // Insert to my collection
  my_collection.insertMultiple(
    [
      {name: 'John'},
      {name: 'Smith'},
      {name: 'Sara'}
    ],
    mySchema,
    (success) => alert('success'),
    (error) => alert(error)
  );
  
  return (
    <>
      <Text>Try Multiple insert</Text>
    </>
  );

};

export default App;
```
