Update a database class in Weaviate.
npm i -g weaviate-class-updater
weaviate-class-updater
Alternatively, provide a config file.
weaviate-class-updater -f ./data/config.json
Instead of using the client
properties in the configuration file, you can alternatively specify them using environment variables.
Variable | Default value |
---|---|
WEAVIATE_HOST | 'localhost:8888' |
WEAVIATE_SCHEME | 'http' |
WEAVIATE_AUTH_CLIENT_SECRET | |
WEAVIATE_API_KEY | |
WEAVIATE_HEADERS |
Example configuration file to add two properties to the Article
schema, authors
and sentiment
. Note that the client
is optional, and can also be provided via environment variables or left blank to use the defaults.
{
"client": {
"authClientSecret": "",
"apiKey": "",
"host": "localhost:8888",
"scheme": "http",
"headers": ""
},
"updates": [
{
"className": "Article",
"properties": [
{
"dataType": ["text[]"],
"description": "Authors of the article, if any",
"name": "authors",
"indexInverted": true
},
{
"dataType": ["number"],
"description": "Sentiment of the article",
"name": "sentiment",
"indexInverted": true
}
]
}
]
}
git clone https://github.com/erikvullings/weaviate-class-updater
npm i
npm start