langchain/libs/community/langchain_community/vectorstores
Mohammad Anash 12bcc85927
added operator filter for supabase (#29475)
Description
This PR adds support for MongoDB-style $in operator filtering in the
Supabase vectorstore implementation. Currently, filtering with $in
operators returns no results, even when matching documents exist. This
change properly translates MongoDB-style filters to PostgreSQL syntax,
enabling efficient multi-document filtering.
Changes

Modified similarity_search_by_vector_with_relevance_scores to handle
MongoDB-style $in operators
Added automatic conversion of $in filters to PostgreSQL IN clauses
Preserved original vector type handling and numpy array conversion
Maintained compatibility with existing postgrest filters
Added support for the same filtering in
similarity_search_by_vector_returning_embeddings

Issue
Closes #27932

Implementation Notes
No changes to public API or function signatures
Backwards compatible - behavior unchanged for non-$in filters
More efficient than multiple individual queries for multi-ID searches
Preserves all existing functionality including numpy array conversion
for vector types

Dependencies
None

Additional Notes
The implementation handles proper SQL escaping for filter values
Maintains consistent behavior with other vectorstore implementations
that support MongoDB-style operators
Future extensions could support additional MongoDB-style operators ($gt,
$lt, etc.)

---------

Co-authored-by: Chester Curme <chester.curme@gmail.com>
2025-01-29 14:24:18 +00:00
..
docarray multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
redis community: recommend RedisVectorStore over Redis (#28749) 2024-12-16 21:08:30 +00:00
__init__.py community[minor]: Add TablestoreVectorStore (#25767) 2024-12-13 11:17:28 -08:00
aerospike.py docs, community: aerospike docs update (#28717) 2024-12-14 00:27:37 +00:00
alibabacloud_opensearch.py
analyticdb.py
annoy.py
apache_doris.py community[patch]: Fix validation error in SettingsConfigDict across multiple Langchain modules (#26852) 2024-09-25 10:02:14 -04:00
aperturedb.py core[patch]: Deprecating beta upsert APIs in vectorstore (#25069) 2024-08-09 17:17:36 -04:00
astradb.py multiple: update removal targets (#25361) 2024-08-14 09:50:39 -04:00
atlas.py community[patch]: Add missing annotations (#24890) 2024-07-31 18:13:44 +00:00
awadb.py community[patch]: Add missing annotations (#24890) 2024-07-31 18:13:44 +00:00
azure_cosmos_db_no_sql.py community: missing mandatory parameter partition_key for AzureCosmosDBNoSqlVectorSearch (#29382) 2025-01-23 10:05:10 -05:00
azure_cosmos_db.py cosmosdbnosql: Added Cosmos DB NoSQL Semantic Cache Integration with tests and jupyter notebook (#24424) 2024-12-16 21:57:05 -05:00
azuresearch.py fixed similarity search with score error #29407 (#29413) 2025-01-27 20:34:42 +00:00
bagel.py community[patch]: Add missing annotations (#24890) 2024-07-31 18:13:44 +00:00
bageldb.py
baiducloud_vector_search.py
baiduvectordb.py
bigquery_vector_search.py multiple: update removal targets (#25361) 2024-08-14 09:50:39 -04:00
cassandra.py community: Cassandra Vector Store: modernize implementation (#27253) 2024-10-22 18:11:11 +00:00
chroma.py community: chroma error patch(attribute changed on chroma) (#27827) 2024-11-05 19:43:11 +00:00
clarifai.py docs: fix kwargs docstring (#25010) 2024-08-02 19:54:54 -07:00
clickhouse.py community: Problem with embeddings in new versions of clickhouse. (#26041) 2024-10-11 18:54:50 +00:00
couchbase.py multiple: update removal targets (#25361) 2024-08-14 09:50:39 -04:00
dashvector.py
databricks_vector_search.py community: Add deprecation notice for Databricks integration in langchain-community (#27355) 2024-10-16 02:20:40 +00:00
deeplake.py docs: fix kwargs docstring (#25010) 2024-08-02 19:54:54 -07:00
dingo.py
documentdb.py community: Fix AWS DocumentDB similarity_search when filter is None (#24777) 2024-07-29 15:32:05 +00:00
duckdb.py docs: fix kwargs docstring (#25010) 2024-08-02 19:54:54 -07:00
ecloud_vector_search.py
elastic_vector_search.py
elasticsearch.py
epsilla.py support epsilla cloud vector database in langchain (#26065) 2024-09-20 17:14:23 +00:00
faiss.py community: FAISS vectorstore - consistent Document id field (#28728) 2024-12-15 12:23:49 -08:00
falkordb_vector.py community: added FalkorDB vector store support i.e implementation, test, docs an… (#26245) 2024-12-16 19:37:55 +00:00
hanavector.py community: Add support for SAP HANA Vector hnsw index creation (#27884) 2024-12-05 23:29:08 +00:00
hippo.py
hologres.py
infinispanvs.py community[minor]: VectorStore Infinispan. Adding TLS and authentication (#23522) 2024-10-09 10:51:39 -04:00
inmemory.py
jaguar.py
kdbai.py docs: udpated api reference (#25172) 2024-08-14 07:00:17 -07:00
kinetica.py Handled empty search result handling and updated the notebook (#27914) 2024-11-12 13:03:49 -08:00
lancedb.py Fixes: community: fix LanceDB return no metadata (#27024) 2024-12-18 15:21:28 +00:00
lantern.py
llm_rails.py all: test 3.13 ci (#27197) 2024-10-25 12:56:58 -07:00
manticore_search.py community[patch]: Fix validation error in SettingsConfigDict across multiple Langchain modules (#26852) 2024-09-25 10:02:14 -04:00
marqo.py Community: Marqo Index Setting GET Request Updated according to 2.x API version while keep backward compatability for 1.5.x (#28342) 2024-11-26 18:26:56 +00:00
matching_engine.py all: test 3.13 ci (#27197) 2024-10-25 12:56:58 -07:00
meilisearch.py
milvus.py multiple: update removal targets (#25361) 2024-08-14 09:50:39 -04:00
momento_vector_index.py
mongodb_atlas.py multiple: update removal targets (#25361) 2024-08-14 09:50:39 -04:00
myscale.py community: Problem with embeddings in new versions of clickhouse. (#26041) 2024-10-11 18:54:50 +00:00
neo4j_vector.py community[patch]: Neo4j community deprecation (#28130) 2024-11-25 10:34:22 -08:00
nucliadb.py
opensearch_vector_search.py community[minor]: Opensearch hybridsearch implementation (#25375) 2024-12-13 16:34:12 -05:00
oraclevs.py community[patch]: support numpy2 (#28184) 2024-11-27 11:10:58 -05:00
pathway.py
pgembedding.py
pgvecto_rs.py
pgvector.py docs: fix community pgvector deprecation warning formatting (#27094) 2024-10-15 15:45:53 +00:00
pinecone.py pinecone: update pinecone client (#28320) 2024-12-02 22:47:09 -08:00
qdrant.py multiple: update removal targets (#25361) 2024-08-14 09:50:39 -04:00
relyt.py
rocksetdb.py
scann.py community[patch]: update the default hf bge embeddings (#22627) 2024-09-02 22:10:21 +00:00
semadb.py core,langchain,community[patch]: allow langsmith 0.2 (#28598) 2024-12-10 18:50:58 +00:00
singlestoredb.py
sklearn.py
sqlitevec.py community: add sqlite-vec vectorstore (#25003) 2024-09-26 17:37:10 +00:00
sqlitevss.py
starrocks.py community[patch]: Fix validation error in SettingsConfigDict across multiple Langchain modules (#26852) 2024-09-25 10:02:14 -04:00
supabase.py added operator filter for supabase (#29475) 2025-01-29 14:24:18 +00:00
surrealdb.py community[patch]: update the default hf bge embeddings (#22627) 2024-09-02 22:10:21 +00:00
tablestore.py community: tablestore vector store check the dimension of the embedding when writing it to store. (#28812) 2024-12-19 09:30:43 -05:00
tair.py
tencentvectordb.py community: implement _select_relevance_score_fn for tencent vectordb (#28036) 2024-12-04 03:03:00 +00:00
thirdai_neuraldb.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
tidb_vector.py <Community>: tidb vector support vector index (#19984) 2024-08-23 13:59:23 -04:00
tigris.py
tiledb.py
timescalevector.py
typesense.py
upstash.py
usearch.py core,langchain,community[patch]: allow langsmith 0.2 (#28598) 2024-12-10 18:50:58 +00:00
utils.py
vald.py community[patch]: update the default hf bge embeddings (#22627) 2024-09-02 22:10:21 +00:00
vdms.py all: test 3.13 ci (#27197) 2024-10-25 12:56:58 -07:00
vearch.py
vectara.py core: add kwargs support to VectorStore (#25934) 2024-12-16 18:57:57 +00:00
vespa.py
vikingdb.py
vlite.py
weaviate.py docs: fix kwargs docstring (#25010) 2024-08-02 19:54:54 -07:00
xata.py
yellowbrick.py
zep_cloud.py docs: fix kwargs docstring (#25010) 2024-08-02 19:54:54 -07:00
zep.py docs: fix kwargs docstring (#25010) 2024-08-02 19:54:54 -07:00
zilliz.py