Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Deta Base Delete using filter query. #236

Answered by BetaHuhn
harshitsinghai77 asked this question in Help
Discussion options

You must be logged in to vote

Hi @harshitsinghai77,

Deta currently doesn't offer a deleteMany method, so you need to manually delete each item.

What you can do for your example is fetch all records with the same user_id and then loop through the returned records and delete each one individually by their key:

records = db.fetch({ "user_id": "Harshit" })

for record in records:
   db.delete(record.key)

Hope this helps!

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
2 replies
@harshitsinghai77
Comment options

@abdelhai
Comment options

Answer selected by abdelhai
Comment options

You must be logged in to vote
7 replies
@harshitsinghai77
Comment options

@harshitsinghai77
Comment options

@jnsougata
Comment options

@harshitsinghai77
Comment options

@jnsougata
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
4 participants