diff --git a/docs/quickstart/typesense.mdx b/docs/quickstart/typesense.mdx index 08eabd151..ca105f0ca 100644 --- a/docs/quickstart/typesense.mdx +++ b/docs/quickstart/typesense.mdx @@ -37,7 +37,7 @@ By the end, you'll have hands-on experience setting up Postgres change data capt -p 8108:8108 \ -v ./typesense-data:/data \ --restart on-failure \ - typesense/typesense:28.0 \ + typesense/typesense:29.0 \ --data-dir /data \ --api-key=my-api-key \ --enable-cors @@ -107,8 +107,17 @@ By the end, you'll have hands-on experience setting up Postgres change data capt ```elixir def transform(action, record, changes, metadata) do - Map.take(record, ["id", "name", "price"]) + record + |> Map.take(["id", "name", "price"]) + |> Map.update("id", nil, fn id -> + cond do + is_binary(id) -> id + is_integer(id) -> Integer.to_string(id) + true -> to_string(id) + end + end) end + ``` This transform will take the `id`, `name`, and `price` fields from the `products` table and use them to create a new document in Typesense. @@ -129,7 +138,7 @@ By the end, you'll have hands-on experience setting up Postgres change data capt In the Typesense card, enter your Typesense configuration: - - Host: `http://host.docker.internal:8108` + - Host: `http://host.docker.internal:8108` (or `http://typesense-server:8108`) - Collection: `products` - API Key: `my-api-key` @@ -264,4 +273,4 @@ Now you're ready to connect your own database to Sequin and start streaming chan Setup a Typesense sink to keep your search index in sync. - \ No newline at end of file +