Hi there!
Parameters in Cypher can only be whole expressions - if you want to do
something like this you could try:
*and lower(s.Name)=~'.*' + {name} + '.*'*
Or you could add .* on both sids of the name before you send your query.
Hope this helps,
Andrés
On Thu, Dec 4, 2014 at 2:36 PM, Sachin Rajput <[email protected]>
wrote:
> I want to make this query parametrized
>
> var query = ["Match
> (name:Name)-[r:IN_CLASS]->(class:Class)-[r1:HAS_STUDENTS]->(s:Student)
> where id(s)=",rollno," and lower(s.Name)=~'.*",name,".*' RETURN
> id(s),s.Name limit 5"].join('');
>
> I have tried this code but it is giving error :
>
> var query = ["Match
> (name:Name)-[r:IN_CLASS]->(class:Class)-[r1:HAS_STUDENTS]->(s:Student)
> where id(s)=",rollno," and lower(s.Name)=~'.*{name}.*' RETURN id(s),s.Name
> limit 5"].join('');
>
> db.query(query , {name : name} , function(err,results){
> if (err) return callback(err);
> if(results){
> return callback(null,results);
> }
> else{
> return callback(null,false);
> }
> });
>
> Please tell me where I am wrong?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Neo4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.