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

Enhanced Delete of Points Method in API: Removing Parameter #12

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## [Unreleased]

## [0.9.6] - 2024-01-13
- Updated Points#delete() method: Removed the requirement to specify points: in parameters. Now generates an error if neither points: nor filters: are provided, aligning with delete_points documentation standards.

## [0.9.5] - 2024-01-12
- Bugfix: ArgumentError for filter in points delete
## [0.9.4] - 2023-08-31
Expand Down
9 changes: 7 additions & 2 deletions lib/qdrant/points.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,21 @@ def upsert(
# Delete points
def delete(
collection_name:,
points:, wait: nil,
points: nil,
wait: nil,
ordering: nil,
filter: nil
)

raise ArgumentError, "Either points or filter should be provided" if points.nil? && filter.nil?

response = client.connection.post("collections/#{collection_name}/#{PATH}/delete") do |req|
req.params["wait"] = wait unless wait.nil?
req.params["ordering"] = ordering unless ordering.nil?

req.body = {}
req.body["points"] = points

req.body["points"] = points unless filter.nil?
req.body["filter"] = filter unless filter.nil?
end
response.body
Expand Down
2 changes: 1 addition & 1 deletion lib/qdrant/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Qdrant
VERSION = "0.9.5"
VERSION = "0.9.6"
end
Loading