# 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;
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pleex.gitbook.io/docs/insertmultiple.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
