async def list_documents(self) → APIResponse:
“”"
Yüklenmiş tüm dökümanların doc_id ve file_name bilgilerini döndürür.
Returns:
APIResponse: Döküman listesi
“”"
try:
collection = self.client.collections.get(DOCUMENT_INDEX_NAME)
response = collection.aggregate.over_all(
group_by=GroupByAggregate(
prop=“full_doc_id”
)
)
print(response)
documents = []
for group in response.groups:
documents.append({
"doc_id": group.grouped_by.value.split("___")[0],
"file_name": group.grouped_by.value.split("___")[1],
"count": group.total_count
})
return documents
except Exception as e:
print(f"Döküman listeleme hatası: {str(e)}")
raise e
That is my listing function for documents
I take this error :
backend-1 | content=APIResponse(is_success=False, error=str(e)).json(),
backend-1 | AggregateReturn(properties={}, total_count=None)
backend-1 | Döküman listeleme hatası: ‘AggregateReturn’ object has no attribute ‘groups’
backend-1 | INFO: 172.19.0.5:41640 - “POST /api/document/upload HTTP/1.1” 500 Internal Server Error
how can ı solve this ?