Skip to content

Commit

Permalink
Merge pull request #12 from Jhonnyr97/feat/points_delete_params
Browse files Browse the repository at this point in the history
Enhanced Delete of Points Method in API: Removing Parameter
  • Loading branch information
andreibondarev committed Jan 13, 2024
2 parents 11be8ac + ecfc6f8 commit 3608d73
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
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

0 comments on commit 3608d73

Please sign in to comment.