Klaus Baumgartner
Klaus Baumgartner

Reputation: 128

In Neo4J Web Admin - how do I provide arguments to a parameterized query?

Say I want to parameterize this simple query: match (u) where u.username={uname} return u

(How) can I provide parameters when executing it in Neo4J web admin?

Upvotes: 0

Views: 136

Answers (2)

jjaderberg
jjaderberg

Reputation: 9952

I don't know if you can do that in the cypher shell, but you can do a REST call.

POST /db/data/cypher
{
  "query": "match (u) where u.username={uname} return u",
  "params": {
    "uname": "user2739920"
  }
}

This will give you a REST response in JSON, which may or may not fit your requirement.

If you use 2.0 the method is :POST and the response is condensed, not 'pretty-printed'.

Upvotes: 2

dev
dev

Reputation: 715

you need passing parameters when you have to use cypher queries in java and you pass it by appending queries.

e.g.

ExecutionResult result = _engine.execute(_query.toString(), _params);

_params is map where you put required values and in _query you write queries with variables in {}.

In web admin we run queries so I don't think it will be needed.Here you will have to hardcode the values.

If there is some special need and any how you have to do this please specify.

Upvotes: 1

Related Questions