Incorrect sort order with Neo4jClient Cypher query -


i have following neo4jclient code

var queryitem = _graphclient         .cypher         .start(new         {             n = node.byindexlookup("myindex", "name", sku),         })         .match("p = n-[r:relationship]->ci")          .with("ci , r")          .return((ci, r) => new          {              n = ci.node<item>(),              r = r.as<relationshipinstance<payload>>()          })          .limit(5)          .results          .orderbydescending(u => u.r.data.frequency); 

the query executing fine results not sorted correctly (i.e. in descending order). here payload class well.

please let me know if see wrong code. tia.

you're doing sorting after .results call. means you're doing in .net, not on neo4j. neo4j returning 5 results, because cypher query doesn't contain sort instruction.

change last 3 lines to:

.orderbydescending("r.frequency") .limit(5) .results; 

as general debugging tip, neo4jclient 2 things:

  1. it helps construct cypher queries using fluent interface.
  2. it executes these queries you. dumb process: send text neo4j, , gives objects back.

the execution working, need work out why queries different.

  1. read doco @ http://hg.readify.net/neo4jclient/wiki/cypher (we write reason)
  2. read "debugging" section on page tells how query text
  3. compare query text expected run
  4. resolve difference (or report issue @ http://hg.readify.net/neo4jclient/issues/new if it's library bug)

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -