Hi Luanne,
This query is working fine for sorting the dates but now there is 1 issue
with *SKIP* if I pass *SKIP 0 LIMIT 25* then it works fine and returns 25
rows, but when I pass *SKIP 10 LIMIT 25* then also it returns 25 rows.

Here I noticed that it is adding and returning from all the nodes but I
want total no of rows which are in the limit.

-Sukaant Chaudhary


On Mon, Dec 30, 2013 at 6:55 PM, Luanne Coutinho
<luanne.couti...@gmail.com>wrote:

> Sukaant, you have the > again after the "with distinct m".
> To find out the cause of errors, please try debugging by breaking up the
> query to isolate the faulty part.
>
> e.g.
> Try
> START n=node(2) MATCH (n)-[:FOLLOWED_BY*..5]->(m)
> Return m
> (no error)
>
> Then try
>
> START n=node(2) MATCH (n)-[:FOLLOWED_BY*..5]->(m)
> WITH distinct m >
> return m
>
> -->Error, so check the clause you added last i.e. the With clause.
>
> This query
> START n=node(2) MATCH (n)-[:FOLLOWED_BY*..5]->(m) WITH distinct m
> MATCH (m)-[:PUBLISHED_UNDER*..5]->(l) WHERE l.eventStartDate + 
> l.eventStartTime >= "2013-12-3017:37:00" OR l.eventEndDate + 
> l.eventEndTime>="2013-12-3017:37:00" RETURN l ORDER BY l.eventStartDate + 
> l.eventStartTime ASC SKIP 0 LIMIT 25;
>
> worked fine for me on your database.
>
> -Luanne
>
>
> On Mon, Dec 30, 2013 at 6:17 PM, Sukaant Chaudhary <
> sukaant.chaudh...@gmail.com> wrote:
>
>> Hi Luanne,
>> I tried the following query:
>>
>>    -
>>    neo4j-sh (?)$ START n=node(2) MATCH (n)-[:FOLLOWED_BY*..5]->(m) WITH 
>> distinct m > MATCH (m)-[:PUBLISHED_UNDER*..5]->(l) WHERE l.eventStartDate + 
>> l.eventStartTime >= "2013-12-3017:37:00" OR l.eventEndDate + 
>> l.eventEndTime>="2013-12-3017:37:00" RETURN l ORDER BY l.eventStartDate + 
>> l.eventStartTime ASC SKIP 0 LIMIT 25;
>>    -
>>    ==> SyntaxException: Invalid input ':': expected whitespace, an 
>> identifier, an expression or ']' (line 1, column 80)
>>    -
>>    ==> "START n=node(2) MATCH (n)-[:FOLLOWED_BY*..5]->(m) WITH distinct m > 
>> MATCH (m)-[:PUBLISHED_UNDER*..5]->(l) WHERE l.eventStartDate + 
>> l.eventStartTime >= "2013-12-3017:37:00" OR l.eventEndDate + 
>> l.eventEndTime>="2013-12-3017:37:00" RETURN l ORDER BY l.eventStartDate + 
>> l.eventStartTime ASC SKIP 0 LIMIT 25"
>>    - ==>
>>
>> Please check this
>>
>> -Sukaant Chaudhary
>>
>>
>> On Mon, Dec 30, 2013 at 6:07 PM, Luanne Coutinho <
>> luanne.couti...@gmail.com> wrote:
>>
>>> You are missing the quotes around the l.eventEndTime>=2013-12-3017:37:00
>>> string.
>>>
>>> Please keep the mailing list copied, other folks can also contribute.
>>>
>>> Regards
>>> Luanne
>>>
>>>
>>> On Mon, Dec 30, 2013 at 5:53 PM, Sukaant Chaudhary <
>>> sukaant.chaudh...@gmail.com> wrote:
>>>
>>>> Hi Luanne,
>>>> I tried the following query:
>>>>
>>>> START n=node(2) MATCH (n)-[:FOLLOWED_BY*..5]->(m) WITH distinct m >
>>>> MATCH (m)-[:PUBLISHED_UNDER*..5]->(l) WHERE l.eventStartDate +
>>>> l.eventStartTime >= '2013-12-3017:37:00' OR l.eventEndDate +
>>>> l.eventEndTime>=2013-12-3017:37:00 RETURN l ORDER BY l.eventStartDate +
>>>> l.eventStartTime ASC SKIP 0 LIMIT 25;
>>>>
>>>> Now I'm getting the following exception:
>>>>
>>>> SyntaxException: Invalid input ':': expected whitespace, an identifier, an 
>>>> expression or ']' (line 1, column 80)
>>>>
>>>>    -
>>>>    ==> "START n=node(2) MATCH (n)-[:FOLLOWED_BY*..5]->(m) WITH distinct m 
>>>> > MATCH (m)-[:PUBLISHED_UNDER*..5]->(l) WHERE l.eventStartDate + 
>>>> l.eventStartTime >= '2013-12-3017:37:00' OR l.eventEndDate + 
>>>> l.eventEndTime>=2013-12-3017:37:00 RETURN l ORDER BY l.eventStartDate + 
>>>> l.eventStartTime ASC SKIP 0 LIMIT 25"
>>>>    - ==
>>>>    ^
>>>>
>>>>
>>>>
>>>> -Sukaant Chaudhary
>>>>
>>>>
>>>> On Mon, Dec 30, 2013 at 5:38 PM, Luanne Coutinho <
>>>> luanne.couti...@gmail.com> wrote:
>>>>
>>>>> Sukaant, just make a string with your format:
>>>>> "2013-12-3017:37:00"
>>>>>
>>>>> And use that in place of timestamp().
>>>>> That will work on the console.
>>>>> If passing a in a value through a programming  language/api, then
>>>>> please parameterize your query by following
>>>>> http://docs.neo4j.org/chunked/milestone/cypher-parameters.html
>>>>>
>>>>> -Luanne
>>>>>
>>>>>
>>>>> On Mon, Dec 30, 2013 at 5:34 PM, Sukaant Chaudhary <
>>>>> sukaant.chaudh...@gmail.com> wrote:
>>>>>
>>>>>> Hi Luanne,
>>>>>> Please try the following query in the given URL
>>>>>> and help me how to pass in a string value of the current datetime to
>>>>>> compare:
>>>>>>
>>>>>> START n=node(2) MATCH (n)-[s:FOLLOWED_BY*..5]->(m) WITH distinct m >
>>>>>> MATCH (m)-[r:PUBLISHED_UNDER*..5]->(l) WHERE l.eventStartDate +
>>>>>> l.eventStartTime >= timestamp() OR l.eventEndDate +
>>>>>> l.eventEndTime>=timestamp() RETURN l ORDER BY l.eventStartDate +
>>>>>> l.eventStartTime ASC SKIP 0 LIMIT 25;
>>>>>>
>>>>>>
>>>>>> http://ec2-54-213-105-153.us-west-2.compute.amazonaws.com:7474/webadmin/#/console/
>>>>>>
>>>>>> -Sukaant Chaudhary
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>

-- 
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 neo4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to