---
title: "Switch Operations to a Different Node"
url: "https://docs.ravendb.net/6.2/client-api/operations/how-to/switch-operations-to-a-different-node"
version: "6.2"
language: "nodejs"
---

# Switch Operations to a Different Node

> Client language: Node.js. Also available for [C#](https://docs.ravendb.net/6.2/client-api/operations/how-to/switch-operations-to-a-different-node.md), [PHP](https://docs.ravendb.net/6.2/client-api/operations/how-to/switch-operations-to-a-different-node.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**
>
> - By default, when working with multiple nodes,  
>   all client requests will access the server node that is defined by the client configuration.  
>   (Learn more in: [Load balancing client requests](https://docs.ravendb.net/6.2/client-api/configuration/load-balance/overview.md)).
>
> - However, **server maintenance operations** can be executed on a specific node by using the `forNode` method.  
>   (An exception is thrown if that node is not available).
>
> - In this page:
>   - [Server maintenance operations - forNode](#server-maintenance-operations---fornode)

## Server maintenance operations - forNode

- For reference, all server maintenance operations are listed [here](https://docs.ravendb.net/6.2/client-api/operations/what-are-operations.nodejs.md#server-maintenance-operations).

```javascript
// Default node access can be defined on the store        
const documentStore = new DocumentStore(["serverUrl_1", "serverUrl_2", "..."], "DefaultDB");

// For example:
// With readBalanceBehavior set to: 'FastestNode':
// Client READ requests will address the fastest node
// Client WRITE requests will address the preferred node
documentStore.conventions.readBalanceBehavior = "FastestNode";
documentStore.initialize();

// Use 'forNode' to override the default node configuration 
// Get a server operation executor for a specific node
const serverOpExecutor = await documentStore.maintenance.server.forNode("C");

// The maintenance.server operation will be executed on the specified node 'C'
const dbNames = await serverOpExecutor.send(new GetDatabaseNamesOperation(0, 25));
```

**Syntax**:

```javascript
await store.maintenance.server.forNode(nodeTag);
```

| Parameters | Type | Description |
| - | - | - |
| **nodeTag** | string | The tag of the node to operate on |

| Return Value | |
| - | - |
| `Promise<ServerOperationExecutor>` | A promise that returns a new instance of Server Operation Executor<br />scoped to the requested node |

## See also

- [What are Operations](https://docs.ravendb.net/6.2/client-api/operations/what-are-operations.nodejs.md)
