mirror of
https://github.com/HKUDS/LightRAG.git
synced 2025-11-15 09:33:38 +00:00
commit
e4e678f80b
@ -50,3 +50,6 @@ class JsonKVStorage(BaseKVStorage):
|
|||||||
for doc_id in ids:
|
for doc_id in ids:
|
||||||
self._data.pop(doc_id, None)
|
self._data.pop(doc_id, None)
|
||||||
await self.index_done_callback()
|
await self.index_done_callback()
|
||||||
|
|
||||||
|
async def drop(self) -> None:
|
||||||
|
self._data = {}
|
||||||
|
|||||||
@ -117,6 +117,10 @@ class MongoKVStorage(BaseKVStorage):
|
|||||||
# Mongo handles persistence automatically
|
# Mongo handles persistence automatically
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
async def drop(self) -> None:
|
||||||
|
"""Drop the collection"""
|
||||||
|
await self._data.drop()
|
||||||
|
|
||||||
|
|
||||||
@final
|
@final
|
||||||
@dataclass
|
@dataclass
|
||||||
@ -198,6 +202,10 @@ class MongoDocStatusStorage(DocStatusStorage):
|
|||||||
# Mongo handles persistence automatically
|
# Mongo handles persistence automatically
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
async def drop(self) -> None:
|
||||||
|
"""Drop the collection"""
|
||||||
|
await self._data.drop()
|
||||||
|
|
||||||
|
|
||||||
@final
|
@final
|
||||||
@dataclass
|
@dataclass
|
||||||
|
|||||||
@ -61,3 +61,8 @@ class RedisKVStorage(BaseKVStorage):
|
|||||||
async def index_done_callback(self) -> None:
|
async def index_done_callback(self) -> None:
|
||||||
# Redis handles persistence automatically
|
# Redis handles persistence automatically
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
async def drop(self) -> None:
|
||||||
|
keys = await self._redis.keys(f"{self.namespace}:*")
|
||||||
|
if keys:
|
||||||
|
await self._redis.delete(*keys)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user