Skip to content

Commit 2f58f83

Browse files
Update readme and changelog for breaking object.update change
1 parent 44ca21d commit 2f58f83

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
## [Unreleased]
22

3+
## [0.9.0] - 2024-07-08
4+
5+
- Add object.replace method which uses PUT which performs a complete object replacement
6+
7+
### Breaking
8+
- Change the object.update method to use PATCH which only performs a partial update(previously performed a replacement)
9+
10+
## [0.8.11] - 2024-07-02
11+
- Allow the user to specify any options they want for multi-tenancy when creating a schema using their own hash
12+
- Allow Ollama vectorizer
13+
314
## [0.8.5] - 2023-07-19
415
- Add multi-tenancy support
516

README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,17 @@ client.objects.exists?(
123123
id: "uuid"
124124
)
125125

126-
# Delete a single data object from Weaviate.
127-
client.objects.delete(
126+
# Perform a partial update on an object based on its uuid.
127+
client.objects.update(
128128
class_name: "Question",
129-
id: "uuid"
129+
id: "uuid",
130+
properties: {
131+
category: "simple-math"
132+
}
130133
)
131134

132-
# Update a single data object based on its uuid.
133-
client.objects.update(
135+
# Replace an object based on its uuid.
136+
client.objects.replace(
134137
class_name: "Question",
135138
id: "uuid",
136139
properties: {
@@ -140,6 +143,12 @@ client.objects.update(
140143
}
141144
)
142145

146+
# Delete a single data object from Weaviate.
147+
client.objects.delete(
148+
class_name: "Question",
149+
id: "uuid"
150+
)
151+
143152
# Batch create objects
144153
client.objects.batch_create(objects: [
145154
{

lib/weaviate/objects.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def update(
122122
)
123123
validate_consistency_level!(consistency_level) unless consistency_level.nil?
124124

125-
response = client.connection.patch("#{PATH}/#{class_name}/#{id}") do |req|
125+
response = client.connection.patch("#{PATH}/#{class_name}/#{id}") do |req|
126126
req.params["consistency_level"] = consistency_level.to_s.upcase unless consistency_level.nil?
127127

128128
req.body = {}

0 commit comments

Comments
 (0)