Skip to content

Commit

Permalink
Use ID instead of FK to delete all docs in a collection
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeyson committed Aug 6, 2024
1 parent c758ec8 commit 8e83cc2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ex_typesense/document.ex
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ defmodule ExTypesense.Document do
def delete_all_documents(conn \\ Connection.new(), collection_name)

def delete_all_documents(conn, collection_name) when is_binary(collection_name) do
delete_documents_by_query(conn, collection_name, %{filter_by: "#{collection_name}_id:>=0"})
delete_documents_by_query(conn, collection_name, %{filter_by: "id:!=0"})
end

def delete_all_documents(conn, collection_name) when is_atom(collection_name) do
Expand Down

0 comments on commit 8e83cc2

Please sign in to comment.