I am using the Weaviate Cloud Services. I created a schema named test_schema_1
. That worked fine. I then added this code to my utility script to avoid recreating the schema if it exists:
const useCollectionName = 'test_schema_1';
const bIsExistingCollection =
await client.collections.exists(useCollectionName);
if (bIsExistingCollection) {
console.warn(CONSOLE_CATEGORY, `The following schema already exists. Not creating schema: ${useCollectionName}`);
} else {
console.info(CONSOLE_CATEGORY, `Creating schema named: ${useCollectionName}`);
await addSchema(neoBlockchainSchema);
}
Unfortunately, “client.collections.exists(useCollectionName)” is returning false. Therefore, when the addSchema
call is made, I get a “duplicate schema” error:
usage error (422): {"error":[{"message":"class name \"test_schema_1\" already exists"}]}
I am using the JS/TS beta version of the client. Is this a bug? Should I open a GitHub issue on this?