---
title: "Reset Index Operation"
url: "https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/reset-index"
version: "6.2"
language: "nodejs"
---

# Reset Index Operation

> Client language: Node.js. Also available for [C#](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/reset-index.md), [Java](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/reset-index.java.md), [Python](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/reset-index.python.md), [PHP](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/reset-index.php.md).
>
> RavenDB publishes an official agent skill for coding assistants at https://docs.ravendb.net/skills/ravendb/SKILL.md (also installable with `npx skills add ravendb/skills`). The skill describes itself as: "Read this before writing any RavenDB query, client call or /databases/ request. Covers server setup, document modelling, the Node.js, .NET and Python clients, RQL, indexes, vector search and AI agents. Code written from recall tends to run and return the wrong rows, because RQL resembles SQL and the clients take field names as plain strings."

> **Note**
>
> - Use `ResetIndexOperation` to rebuild an index:
>   - All existing indexed data will be removed.
>   - All items matched by the index definition will be re-indexed.
>
> - **Indexes scope**:
>   - Both static and auto indexes can be reset.
>
> - **Nodes scope**:
>   - When resetting an index from the **client**:  
>     The index is reset only on the preferred node only, and Not on all the database-group nodes.
>   - When resetting an index from the **Studio** [indexes list](https://docs.ravendb.net/6.2/studio/database/indexes/indexes-list-view.md#indexes-list-view---actions) view:  
>     The index is reset on the local node the browser is opened on, even if it is Not the preferred node.
>
> - If the index is [disabled](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/disable-index.nodejs.md)
>   or [paused](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/stop-index.nodejs.md), resetting the index
>   will put it back to the **normal** running state on the local node where the action was performed.
>
> - In this page:
>   - [Reset index](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/set-index-priority.nodejs.md#set-priority---single-index)
>   - [Syntax](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/set-index-priority.nodejs.md#syntax)

## Reset index

```javascript
// Define the reset index operation, pass index name
const resetIndexOp = new ResetIndexOperation("Orders/Totals");

// Execute the operation by passing it to maintenance.send
// An exception will be thrown if index does not exist
await store.maintenance.send(resetIndexOp);
```

## Syntax

```javascript
const resetIndexOp = new ResetIndexOperation(indexName);
```

| Parameters | Type | Description |
| - | - | - |
| **indexName** | `string` | Name of an index to reset |

## See also

- [What are Indexes](https://docs.ravendb.net/6.2/indexes/what-are-indexes.nodejs.md)
- [Creating and Deploying Indexes](https://docs.ravendb.net/6.2/indexes/creating-and-deploying.nodejs.md)
- [Index Administration](https://docs.ravendb.net/6.2/indexes/index-administration.md)
- [How to Get Index](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/get-index.nodejs.md)
- [How to Put Indexes](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/put-indexes.nodejs.md)
- [How to Delete Index](https://docs.ravendb.net/6.2/client-api/operations/maintenance/indexes/delete-index.nodejs.md)
