I want to restrict the search during querying time in chromaDB by filtering based on the dates I’m storing in the metadata. I want to only search for documents between 2 dates. I tried the following where condition –
<code>
results = collection.query(
query_embeddings=query_embedding,
n_results=5,
where={"timestamp":
{"$lte":datetime.strptime('2024-01-10',"%Y-%m-%d").timestamp(),
"$gte":datetime.strptime('2024-01-01',"%Y-%m-%d").timestamp()}},
)
</code>
<code>
results = collection.query(
query_embeddings=query_embedding,
n_results=5,
where={"timestamp":
{"$lte":datetime.strptime('2024-01-10',"%Y-%m-%d").timestamp(),
"$gte":datetime.strptime('2024-01-01',"%Y-%m-%d").timestamp()}},
)
</code>
results = collection.query(
query_embeddings=query_embedding,
n_results=5,
where={"timestamp":
{"$lte":datetime.strptime('2024-01-10',"%Y-%m-%d").timestamp(),
"$gte":datetime.strptime('2024-01-01',"%Y-%m-%d").timestamp()}},
)
But I am getting this error-
Can someone tell me where I’m going wrong?