Hello, I want to query a many to many relationship...
# community-help
f
Hello, I want to query a many to many relationship but I'm having trouble with the syntax. Consider the following schema:
{
"name":  "priceLists",
"fields": [
{"name": "id", "type": "string"},
{"name": "name", "type": "string"},
{"name": "enabled", "type": "bool"}
]
}
{
"name":  "products",
"fields": [
{"name": "id", "type": "string"},
{"name": "name", "type": "string"}
]
}
{
"name":  "priceList_products_access",
"fields": [
{"name": "priceList_id", "type": "string", "reference": "priceLists.id"},
{"name": "product_id", "type": "string", "reference": "products.id"},
]
}
In the following query: { "q": "*", "collection": "products", "query_by": "name", "filter_by": "$priceList_products_access(priceList_id 1)", "include_fields": "$priceLists(*)" } I want to add a enabled=true filter for the priceList schema. Ideally it want the products that have the enabled pricelist. Any ideas?