-
Notifications
You must be signed in to change notification settings - Fork 22
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
How to loop through all records? #294
Comments
Hello, Tyler!
If the amount of documents is really large, keep in mind that you may prefer to work in (client-managed) batches and/or keep track of whether the update has been made, with the help of auxiliary metadata in the documents (e.g. Let me know if this helps and if you think an explicit example will help you further! |
Assuming you are working with Django. You can Query All Records: from myapp.models import MyModel # Replace with your actual model
from cassandra.cqlengine.management import sync_table
sync_table(MyModel)
records = MyModel.objects.all()
for record in records:
record.some_field = 'new_value' # Replace with your actual modifications
record.save() |
@Tylersuard I suspect the reply above (related to Django and based on Cassandra as opposed as the Data API of Astra) is not very relevant. |
Hello, I would like to loop through every record in my database, modify it, and then update it. How can I do that? Thank you for your help.
The text was updated successfully, but these errors were encountered: