langchain-ai / langchain-postgres

LangChain abstractions backed by Postgres Backend
MIT License
66 stars 22 forks source link

vectorstore: Add support to filter by IS NULL and IS NOT NULL criteria #40

Closed MartinGotelli closed 1 month ago

MartinGotelli commented 1 month ago

Description: Add support to filter by IS NULL criteria in the metadata Issue: N/A Dependencies: N/A Twitter handle: @martinferenaz

This PR fixes the problem when you want to search if a tag has a value (exists) in the metadata. To check that you need to compare with the "IS NULL" method and the "$eq" operator only checks that the tag exists and has a null value assigned.

In addition, a test for the $nin condition was added and a bug arrised, the bug was resolved adding a not condition after the in_