Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8670205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:39:29+00:00 2026-06-12T18:39:29+00:00

I have a Neo4j database graphDb where nodes have a property ‘label’ . I

  • 0

I have a Neo4j database graphDb where nodes have a property 'label'. I have a Lucene index 'my_nodes' with key ‘label’ which indexes the values of node property ‘label’. Now I want to retrieve nodes which have property ‘label’ equal to a value from a list of possible values labellist. To accomplish this, I wrote a Cypher query the following way:

cypherQ =       """START n=node:my_nodes('""" 
                   +' OR '.join(['label:'+str(i) for i in labellist]) + """')
                   RETURN n"""
result = graphDb.query(cypherQ)

That works fine, but I wonder whether there is a way to write a parameterized query anyhow?

I tried something like:

cypherQ =       """START n=node:my_nodes('label:{params}')
                   RETURN n"""
result = graphDb.query(cypherQ, params = labellist)

But this surely does not work, though if there is one value in labellist it works. And the neo4j tutorial does not provide much material on this issue.

Once again I am using a python binding for Neo4j.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T18:39:30+00:00Added an answer on June 12, 2026 at 6:39 pm

    The parameter is working for the whole query part of the index, so this would be

    cypherQ =       """START n=node:my_nodes({queryParam})
                   RETURN n"""
    

    and you construct the query in your client code and pass it into Cypher as one parameter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have a vertex {first_name, last_name} in a graph database (Neo4j in this
I have a lot of nodes and relationships to store to Neo4J. I have
I have a fresh build of neo4j-rest-graphdb-1.8-SNAPSHOT.jar . But I'm having trouble right out
I have the following code package myPackage; import org.neo4j.graphdb; import org.neo4j.kernel.EmbeddedGraphDatabase; public class dbServlet
I am creating a new Neo4j database. I have a type of node called
I have a graph database in ne04j where the nodes are connected to each
I've been using Neo4j for a little while now and have an app up
I have a graph, well, a series of disconnected graphs in Neo4j. I want
I'm using Spring data neo4j 2.1.0.BUILD-SNAPSHOT and Neo4j 1.6.1 server. I have a Friendship
have written this little class, which generates a UUID every time an object of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.