Error storing in Weaviate #5753
Replies: 1 comment
-
To resolve the "Error adding vectors: Error: usage error (415)" when trying to store data in Weaviate after updating your cluster configuration, ensure that the documents you are trying to insert do not have an if (Object.hasOwn(document.metadata, "id"))
throw new Error(
"Document inserted to Weaviate vectorstore should not have `id` in their metadata."
); Make sure to remove any documents.forEach(doc => {
if (doc.metadata && doc.metadata.id) {
delete doc.metadata.id;
}
}); Then proceed with adding the documents: await weaviateStore.addDocuments(documents); Additionally, ensure that your metadata keys are valid GraphQL names, as invalid keys can also cause issues: if (args.metadataKeys) {
this.queryAttrs = [
...new Set([
...this.queryAttrs,
...args.metadataKeys.filter((k) => {
const keyIsValid = /^[_A-Za-z][_0-9A-Za-z]*$/.test(k);
if (!keyIsValid) {
console.warn(
`Skipping metadata key ${k} as it is not a valid GraphQL Name`
);
}
return keyIsValid;
}),
]),
];
} By ensuring that your metadata keys are valid and removing any |
Beta Was this translation helpful? Give feedback.
-
Checked other resources
Commit to Help
Example Code
Description
I need to store in weAviate earlier I am using older cluster now I just changed my cluster in my weaviate and its is showing error I just change the keys here like host and apiKey of weAviate to make new client but getting error
Error: Error: Error adding vectors: Error: usage error (415):
at WeaviateStore.addVectors (file:///C:/Users/LakshyaTambi
System Info
ok
Beta Was this translation helpful? Give feedback.
All reactions