Skip to content

Commit efa0b2a

Browse files
Update README.md
1 parent 8908462 commit efa0b2a

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

README.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ If bundler is not being used to manage dependencies, install the gem by executin
2222

2323
## Usage
2424

25-
### Instantiating the API client
25+
### Instantiating API client
2626

2727
```ruby
2828
require 'weaviate'
@@ -48,7 +48,7 @@ client.schema.create(
4848
"dataType": ["text"],
4949
"description": "The question",
5050
"name": "question"
51-
} ,{
51+
}, {
5252
"dataType": ["text"],
5353
"description": "The answer",
5454
"name": "answer"
@@ -65,16 +65,18 @@ client.schema.create(
6565
# Get a single class from the schema
6666
client.schema.get(class_name: 'Question')
6767

68-
# Dumps the current Weaviate schema.
69-
response = client.schema.list()
70-
response.data
68+
# Get the schema
69+
client.schema.list()
7170

7271
# Remove a class (and all data in the instances) from the schema.
7372
client.schema.delete(class_name: 'Question')
7473

7574
# Update settings of an existing schema class.
7675
# Does not support modifying existing properties.
77-
client.schema.update(class_name: 'Question')
76+
client.schema.update(
77+
class_name: 'Question',
78+
description: 'Information from a Wheel of Fortune question'
79+
)
7880

7981
# Adding a new property
8082
client.schema.add_property(
@@ -102,31 +104,30 @@ client.objects.create(
102104
)
103105

104106
# Lists all data objects in reverse order of creation.
105-
response = client.objects.list()
106-
response.data
107+
client.objects.list()
107108

108109
# Get a single data object.
109110
client.objects.get(
110111
class_name: "Question",
111-
id: ''
112+
id: "uuid"
112113
)
113114

114-
# Check if a data object exists
115+
# Check if a data object exists.
115116
client.objects.exists?(
116117
class_name: "Question",
117-
id: ''
118+
id: "uuid"
118119
)
119120

120-
# Delete an individual data object from Weaviate.
121+
# Delete a single data object from Weaviate.
121122
client.objects.delete(
122123
class_name: "Question",
123-
id: ""
124+
id: "uuid"
124125
)
125126

126-
# Update an individual data object based on its uuid.
127+
# Update a single data object based on its uuid.
127128
client.objects.update(
128129
class_name: "Question",
129-
id: '',
130+
id: "uuid",
130131
properties: {
131132
question: "What does 6 times 7 equal to?",
132133
category: "math",
@@ -157,7 +158,7 @@ client.objects.batch_create(objects: [
157158
client.objects.batch_delete(
158159
class_name: "Question",
159160
where: {
160-
valueString: "1",
161+
valueString: "uuid",
161162
operator: "Equal",
162163
path: ["id"]
163164
}

0 commit comments

Comments
 (0)