> ## Documentation Index
> Fetch the complete documentation index at: https://doc.lucidworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Managed JavaScript

> Query pipeline stage configuration specifications

[localhost link]: http://localhost:3000/docs/lucidworks-search/09-developer-documentation/config-specs/query-pipeline-stages/managed-javascript-query

[mintlify link]: https://doc.lucidworks.com/docs/lucidworks-search/09-developer-documentation/config-specs/query-pipeline-stages/managed-javascript-query.md

[old doc.lw link]: https://doc.lucidworks.com/managed-fusion/5.9/zfwfyr.md

This stage manipulates a query using a script from the [blob store](https://doc.lucidworks.com/docs/lucidworks-search/04-move-data-in/blob-storage/overview.md). The script must have the blob type `file:js-query`.

**See also: [Custom JavaScript Stages For Query Pipelines](https://doc.lucidworks.com/docs/lucidworks-search/05-move-data-out/query-pipeline/custom-js-query-stages.md).**

> [card] Key questions to get you started
>
> Powered by Lucidworks Agent Studio

## Uploading a JavaScript blob

In Lucidworks Search 5.9, JavaScript blobs must be uploaded using the [Blob Store API](https://doc.lucidworks.com/api-reference/blobs/get-blob-store-service-status.md), like this:

```bash wrap  theme={"dark"}
curl -u USERNAME:PASSWORD -X PUT -H 'Content-Type: text/javascript' --data-binary @query-pipeline-js-stage.js http://EXAMPLE_COMPANY.lucidworks.cloud/api/apps/APP_NAME/blobs/query-pipeline-js-stage.js?resourceType=file:js-query
```

> [!NOTE]
>
> Replace `EXAMPLE_COMPANY` with the name provided by your Lucidworks representative.

Open the [blob manager](https://doc.lucidworks.com/docs/lucidworks-search/04-move-data-in/blob-storage/overview.md) to verify that the new blob is present:

![Uploaded JavaScript blob in the blob manager](https://mintcdn.com/lucidworks/qCaM85k6rX7hs1DP/assets/images/4.1/known-issue-APOLLO-15672-query.png?fit=max\&auto=format\&n=qCaM85k6rX7hs1DP\&q=85\&s=519a545d56c02167555a5f8a8a66414b)

## Referencing a JavaScript blob

Use any of the following formats for the `ref`/**Script Reference** configuration field:

```bash wrap  theme={"dark"}
query-pipeline-js-stage.js
```

```bash wrap  theme={"dark"}
blob:query-pipeline-js-stage.js
```

```bash wrap  theme={"dark"}
urn:x-fusion:blob:query-pipeline-js-stage.js
```

> [!NOTE]
>
> The examples above use `query-pipeline-js-stage.js` as the blob ID.

### Edit JavaScript

Select **Edit** in the **Script Reference** field to edit JavaScript directly in the Lucidworks Search UI.

## Configuration

> [!TIP]
>
> When entering configuration values in the UI, use *unescaped* characters, such as `\t` for the tab character. When entering configuration values in the API, use *escaped* characters, such as `\\t` for the tab character.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.