Skip to content

Add truncate collection documents #40

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

Merged

Conversation

erimicel
Copy link
Contributor

@erimicel erimicel commented Feb 24, 2025

Change Summary

The truncate option mentioned in the Typesense docs could be integrated directly into the gem as a shortcut.

Example:

###
# Truncate a collection
#   Deletion returns the number of documents deleted
collection = @typesense.collections['companies'].truncate
ap collection

# {
#   "num_deleted": 125
# }

PR Checklist

@jasonbosco
Copy link
Member

Thank you for the PR!

@jasonbosco jasonbosco merged commit cdf31c2 into typesense:master Feb 24, 2025
3 checks passed
@jasonbosco
Copy link
Member

Available in 3.0.1

@erimicel erimicel deleted the add_truncate_collection_documents branch April 28, 2025 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants