# Insert

{% openapi src="<https://760328771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LwSkuCpTNI_AerL8J2a%2Fuploads%2FCpzJktmKXD6FMPSah1nK%2Fopenapi.json?alt=media&token=854cdd6a-61b2-49a5-99f4-6bc091e5c3d6>" path="/{version}/db/{CollectionName}" method="post" expanded="true" %}
[openapi.json](https://760328771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LwSkuCpTNI_AerL8J2a%2Fuploads%2FCpzJktmKXD6FMPSah1nK%2Fopenapi.json?alt=media\&token=854cdd6a-61b2-49a5-99f4-6bc091e5c3d6)
{% endopenapi %}

{% tabs %}
{% tab title=".NET" %}

```csharp
var client = new CodeMashClient(apiKey, projectId);
var service = new CodeMashRepository<Person>(client);

var person = new Person { Name = "John" };

await service.InsertOneAsync(person, new DatabaseInsertOneOptions());
```

{% hint style="info" %}
Check the information about [entities](https://docs.codemash.io/api/database/collections/broken-reference) on how your class objects are serialized.
{% endhint %}
{% endtab %}

{% tab title="Node" %}

```javascript
import { db } from 'codemash';

const request = {
    start: '1588855312059', // Unix time stamp in miliseconds
    end: '1588855340191', // Unix time stamp in miliseconds
    employee: 'some_user_id',
    type: 'paid',
};

export async function saveHolidaysRequest(request) {
    const response = await db.saveRecord('holidays', request);
    return response;
}

```

{% endtab %}

{% tab title="PHP" %}

```php
use Codemash\CodemashClient;
use Codemash\CodemashDb;

class CodemashService
{
    protected CodemashDb $codemashDb;
    protected string $collectionName = '{YOUR_COLLECTION_NAME}';

    public function __construct()
    {
        $secretKey = '{YOUR_SECRET_KEY}';
        $projectId = '{YOUR_PROJECT_ID}';

        $client = new CodemashClient($secretKey, $projectId);
        $this->codemashDb = new CodemashDb($client);
    }

    public function insertEmployee()
    {
        $responseData = $this->codemashDb->insertOne([
        	'collectionName' => 'employees',
        	'document' => [
        		'name' => 'John',
        		'email' => 'john@example.com',
        		'address' => 'New York',
        	],
        ]);
    }
}
```

{% endtab %}
{% endtabs %}
