Slackbot
07/26/2023, 1:06 PMJason Bosco
07/26/2023, 4:28 PMKor
07/26/2023, 4:36 PMJason Bosco
07/26/2023, 4:40 PMKor
07/26/2023, 4:41 PMKor
07/26/2023, 4:47 PMKor
07/26/2023, 5:02 PMJason Bosco
07/26/2023, 5:10 PMKor
07/26/2023, 5:19 PMJason Bosco
07/26/2023, 5:19 PMKor
07/26/2023, 5:20 PMJason Bosco
07/26/2023, 5:20 PMKor
07/26/2023, 5:21 PMKor
07/26/2023, 5:25 PMJason Bosco
07/26/2023, 5:26 PMKor
07/26/2023, 5:27 PMJason Bosco
07/26/2023, 5:28 PMJason Bosco
07/26/2023, 5:28 PMJason Bosco
07/26/2023, 5:28 PMJason Bosco
07/26/2023, 5:28 PMI set an override for “TEL” (and not necesserali “tel”?
Kor
07/26/2023, 5:29 PMKor
07/26/2023, 6:42 PMJason Bosco
07/26/2023, 6:43 PMKor
07/26/2023, 6:43 PMKor
07/26/2023, 6:52 PM#!/bin/bash
# Get all overrides
OVERRIDES=$(curl -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" "http://localhost:8108/collections/companies/overrides")
# Extract just the names from the overrides
OVERRIDE_NAMES=$(echo $OVERRIDES | jq -r '.overrides[] | .id')
# Loop over each override name and delete it
for OVERRIDE_NAME in $OVERRIDE_NAMES
do
curl "http://localhost:8108/collections/companies/overrides/$OVERRIDE_NAME" -X DELETE \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}"
done
This script first sends a GET request to the Typesense API to retrieve all overrides. It then uses jq to extract just the IDs of each override into the OVERRIDE_NAMES variable. This is a space-separated list of all override names.
It then loops over each name in OVERRIDE_NAMES, sending a DELETE request to the Typesense API to delete that override.
Make sure to replace ${TYPESENSE_API_KEY} with your actual Typesense API key.
Please note that this will delete ALL overrides for the "companies" collection. If you have overrides that you don't want to delete, you will need to adjust the script to exclude those.
END CHATGPT