> For the complete documentation index, see [llms.txt](https://docs.codemash.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.codemash.io/sdks-and-cli/database/collections/replace-one.md).

# Replace One

**Collections** hold your records. Norbix generates a full CRUD + query API over each collection from its schema, with record-level ownership and triggers. Replaces the one.

This method is on the runtime **API** surface (`norbix.api.database`) — call it from your app.

{% hint style="info" %}
These examples assume the SDK is installed and your credentials are set as environment variables — each client reads them automatically, so the constructors below take no arguments. See [Install a Norbix SDK](/sdks-and-cli/install.md).
{% endhint %}

{% tabs %}
{% tab title="JavaScript / TypeScript" %}

```ts
import { Norbix } from '@norbix.ai/ts';
const norbix = new Norbix();

const result = await norbix.api.database.replaceOne({
  collectionName: 'orders',
  id: 'rec_4kX9mQvR2tYw7ZbC1dFgHj',
  databaseIntegrationId: 'int_4kX9mQvR2tYw7ZbC1dFgHj',
  replacement: 'orders-v2',
});
```

{% endtab %}

{% tab title=".NET" %}

```csharp
using Norbix.Sdk;
using Norbix.Sdk.Types.Api;

using var client = new NorbixClient();

var result = await client.Database.ReplaceOneAsync(new ReplaceOneRequest
{
    CollectionName = "orders",
    Id = "rec_4kX9mQvR2tYw7ZbC1dFgHj",
    DatabaseIntegrationId = "int_4kX9mQvR2tYw7ZbC1dFgHj",
    Replacement = "orders-v2",
});
```

{% endtab %}

{% tab title="Python" %}

```python
from norbix_python import NorbixApi

norbix = NorbixApi()

result = norbix.database.replace_one(
    collectionName="orders",
    id="rec_4kX9mQvR2tYw7ZbC1dFgHj",
    databaseIntegrationId="int_4kX9mQvR2tYw7ZbC1dFgHj",
    replacement="orders-v2",
)
```

{% endtab %}

{% tab title="Go" %}

```go
c, _ := norbix.New(norbix.Options{})
ctx := context.Background()

var result map[string]any
err := c.API.Database.ReplaceOne(ctx, "orders", "rec_4kX9mQvR2tYw7ZbC1dFgHj", map[string]any{
	"databaseIntegrationId": "int_4kX9mQvR2tYw7ZbC1dFgHj",
	"replacement": "orders-v2",
}, &result)
```

{% endtab %}

{% tab title="Dart / Flutter" %}

```dart
import 'package:norbix/norbix_api.dart';

final api = NorbixApi();

final result = await api.database.replaceOne(collectionName: 'orders', id: 'rec_4kX9mQvR2tYw7ZbC1dFgHj', body: {
  'databaseIntegrationId': 'int_4kX9mQvR2tYw7ZbC1dFgHj',
  'replacement': 'orders-v2',
});
```

{% endtab %}

{% tab title="Swift" %}

```swift
import NorbixSwift

let client = Norbix()

let result = try await client.api.database.replaceOne([
    "collectionName": "orders",
    "id": "rec_4kX9mQvR2tYw7ZbC1dFgHj",
    "databaseIntegrationId": "int_4kX9mQvR2tYw7ZbC1dFgHj",
    "replacement": "orders-v2",
])
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
import dev.norbix.sdk.api.NorbixApi

val api = NorbixApi()

val result = api.database.replaceOne(mapOf(
    "collectionName" to "orders",
    "id" to "rec_4kX9mQvR2tYw7ZbC1dFgHj",
    "databaseIntegrationId" to "int_4kX9mQvR2tYw7ZbC1dFgHj",
    "replacement" to "orders-v2",
))
```

{% endtab %}

{% tab title="CLI" %}

```sh
norbix db replace orders --id rec_4kX9mQvR2tYw7ZbC1dFgHj --doc '{"status":"active"}'
```

{% endtab %}
{% endtabs %}

## In the dashboard

Manage this visually in Norbix Cloud — see [Database → Collections](/norbix-cloud/database/collections.md).

## API reference

Full request and response for this endpoint: [Replace One](/api-reference/database/collections/replace-one.md).
