Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Documentation Feedback]: Update javascript code snippet in REST "Update a data object" #858

Open
mattelim opened this issue Jun 2, 2023 · 0 comments

Comments

@mattelim
Copy link

mattelim commented Jun 2, 2023

Page URL

https://weaviate.io/developers/weaviate/api/rest/objects#update-a-data-object

User feedback

Under "Update a data object", within the "Javascript" code snippet:

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)

The line const schema = res.schema; should be changed to const schema = res.properties;.

This allows the code snippet to work and to make it consistent with the rest of the documentation.

@mattelim mattelim changed the title [Documentation Feedback]: [Documentation Feedback]: Rest API / Objects / Update a data obect / Javascript code snippet Jun 2, 2023
@mattelim mattelim changed the title [Documentation Feedback]: Rest API / Objects / Update a data obect / Javascript code snippet [Documentation Feedback]: Update javascript code snippet in REST "Update a data object" Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant