I defined product, contributions and actors (a collection for each). A product has contributions (list of ObjectID) and a contribution has an actor [and a product] (objectID reference). When I want all products with contributions with actors with a certain name or postcode, it doesn’t work. The name or postcode filter is not applied.
The query :
query {
product_contributions(query: { actor: { name: "test"} } ) {
product{
name
}
actor {
name
}
}
products(query: { contributions: { actor : { name: "test" } } }) {
name
contributions {
actor {
name
}
}
}
}
gives
{
"data": {
"product_contributions": [],
"products": [
{
"contributions": [
{
"actor": {
"name": "Coopérative Pur Ardenne"
}
}
],
"name": "Lait de Pâturage demi-écrémé"
}
]
}
}
Both should be empty …
Defined relationship for product :
{
"contributions": {
"foreign_key": "_id",
"ref": "#/relationship/mongodb-atlas/digicirco/product_contributions",
"is_list": true
}
}
Defined relationships for product_contributions :
{
"actor": {
"ref": "#/relationship/mongodb-atlas/digicirco/actors",
"foreign_key": "_id",
"is_list": false
},
"product": {
"ref": "#/relationship/mongodb-atlas/digicirco/products",
"foreign_key": "_id",
"is_list": false
}
}