Skip to main content
You can delete documents by their _id or using an expression. Both methods provide the same consistency guarantees and will be reflected in query/get results according to your consistency level. To delete documents by their _id, you can pass a list of _ids to the delete() function:
client.collection("books").delete(
    ["book-1", "book-2", "book-3"]
)
To delete documents that match a predicate, you can pass a filter expression to the delete() function.
from topk_sdk.query import field

client.collection("books").delete(field("published_year").lt(1997))