Vinelab / NeoEloquent

The Neo4j OGM for Laravel
MIT License
633 stars 197 forks source link

Neo4j Lumen : Binding param in Request with : wraped where (whereNested) [BUG] #247

Closed BenjaminSpb closed 3 years ago

BenjaminSpb commented 6 years ago

When you want wrap "where" in request binding don't work fine.

Example :

=> In the log of lumen i can see the binding of my first "where" was remove :

lumen.INFO: MATCH (campaign:Campaign) WHERE campaign.name = {name} or (campaign.name = {name} and campaign.size = {size}) RETURN count(*)  
 lumen.INFO: Array
(
    [name] => b
    [size] => 4
)

PS : normaly we need to have {name_1} and {name_2} not only {name}

Have you a solution to resolve for this Bug ?

Thanks,

Mulkave commented 6 years ago

Can you please try chaining two orWhere clauses?

$query->where("name", "=", "a");
$query->orWhere(function ($query)  {
            $query->where("name", "=", "b");
            $query->orWhere("size", "=", 4);
 });

Or with this instead:

$query->where("name", "=", "a");
$query->orWhere("name", "=", "b");
$query->orWhere("size", "=", 4);
stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.