-
Notifications
You must be signed in to change notification settings - Fork 30
Closed
Description
I've been using the javascript weaviate-client
and just switched to this one. The migration was painless, and I only needed to make minor changes. One of them, however, surprised me. According to the JS documentation, withProperties
requires an object (called schema in the example code from the website shown at the bottom). However, the TS documentation states it is a any[]
. I prefer if it would be using generics, but shouldn't it be just any
?
TypeScript type definition in updater.d.ts
:
withProperties: (properties: any[]) => this;
JavaScript example from the website:
const weaviate = require('weaviate-client');
const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
});
var className = 'Author';
var id = '36ddd591-2dee-4e7e-a3cc-eb86d30a4303';
client.data
.getterById()
.withClassName(className)
.withId(id)
.do()
.then(res => {
// alter the schema
const schema = res.schema;
schema.name = 'J. Kantor';
return client.data
.updater()
.withId(id)
.withClassName(thingClassName)
.withProperties(schema)
.withConsistencyLevel(weaviate.replication.ConsistencyLevel.ALL) // default QUORUM
.do();
})
.then(res => {
console.log(res)
})
.catch(err => {
console.error(err)
});
Metadata
Metadata
Assignees
Labels
No labels