File size: 1,350 Bytes
abc646e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"""Quick script to check what's stored in ChromaDB metadata collection."""

from services.chroma_service import ChromaService

def check_metadata():
    print("Connecting to ChromaDB...")
    c = ChromaService()
    
    data = c.metadata_collection.get()
    total = len(data['ids'])
    print(f"Total entries in document_metadata: {total}")
    
    if total > 0:
        print("\n--- Sample entry (first) ---")
        meta = data['metadatas'][0]
        for key, value in sorted(meta.items()):
            print(f"  {key}: {value}")
        
        # Find Feb 2026 renewals
        print("\n--- Entries with Feb 2026 renewal ---")
        feb_count = 0
        for meta in data['metadatas']:
            rd = str(meta.get('renewal_date', ''))
            ry = meta.get('renewal_year', 0)
            # Check for Feb 2026
            if ry == 2026 and '-02-' in rd:
                feb_count += 1
                print(f"  {meta.get('document_title')}: renewal_date={rd}, renewal_year={ry}")
        
        print(f"\nTotal Feb 2026 renewals found: {feb_count}")
        
        # Show all unique renewal years
        years = set(meta.get('renewal_year', 0) for meta in data['metadatas'])
        print(f"\nAll renewal years in data: {sorted(years)}")
    else:
        print("No data found!")

if __name__ == "__main__":
    check_metadata()