Typesense icon

Typesense

Interact with the Typesense search platform

Document → Update

AI-generated

Overview

This node operation updates a document in a specified collection within a Typesense instance. It is useful for scenarios where you need to modify existing documents in your search index, such as updating product details, user profiles, or any indexed data. For example, you can update a product's price or description in an e-commerce search collection.

Use Case Examples

  1. Updating a product document in a 'products' collection by specifying the document ID and new field values.
  2. Modifying user information in a 'users' collection by providing raw JSON data for the document update.

Properties

Name Meaning
Collection Name The name of the collection in the Typesense instance where the document resides. This is required to identify the target collection for the update operation.
Document ID The unique identifier of the document to update within the specified collection. This is required to locate the exact document to modify.
JSON Input A boolean flag indicating whether the document data is provided as raw JSON. If true, the document data should be supplied in JSON format.
Document Data (JSON) The raw JSON string representing the document data to update. This is used only if JSON Input is true.
Document Fields A collection of field name and value pairs representing the document data to update. This is used only if JSON Input is false. Field values are parsed as JSON.

Output

JSON

  • document - The updated document data returned from the Typesense instance after the update operation.

Dependencies

  • Typesense API key credential for authentication with the Typesense instance.

Troubleshooting

  • Ensure the collection name and document ID are correct and exist in the Typesense instance to avoid 'document not found' errors.
  • If using JSON Input, verify that the JSON string is well-formed to prevent parsing errors.
  • Check that the Typesense API key credential is valid and has sufficient permissions for updating documents.
  • Handle network or API errors gracefully, possibly by enabling 'Continue On Fail' to process subsequent items even if one update fails.

Discussion