>> start n=node(*)
>> match n-[:rel]->()
>> where has(n.arr) and not(n.prop in n.arr)
>> return n;
>> On Wed, Nov 7, 2012 at 3:54 PM, Wes Freeman <freem...@gmail.com> wrote:
>>> You can't delete via Cypher with that version of Neo.
>>> If you want to just find them, you could do something like (I'm not
>>> entirely sure this worked back then, either--you might consider upgrading):
>>> start n=node(*)
>>> where n.prop in n.arr
>>> return n;
>>> Wes
>>> On Wed, Nov 7, 2012 at 3:43 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>> I have neo4j 1.6.1 and I am using php .
>>>> I have an array "arr" of a particular property "prop" of nodes.
>>>> I want to delete all nodes from neo4j having a certain relationship
>>>> "rel" except for the nodes whose property "prop" is in the array "arr".
If I upgrade to 1.8, then I get the delete queries. Now, If I delete the nodes, will the node ids for other users remain unchanged or neo4j automatically reuses the deleted ids?
>> start n=node(*) >> match n-[:rel]->() >> where has(n.arr) and not(n.prop in n.arr) >> return n;
>> On Wed, Nov 7, 2012 at 3:54 PM, Wes Freeman <freem...@gmail.com> wrote:
>>> You can't delete via Cypher with that version of Neo.
>>> If you want to just find them, you could do something like (I'm not >>> entirely sure this worked back then, either--you might consider upgrading):
>>> start n=node(*) >>> where n.prop in n.arr >>> return n;
>>> Wes
>>> On Wed, Nov 7, 2012 at 3:43 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>> I have neo4j 1.6.1 and I am using php .
>>>> I have an array "arr" of a particular property "prop" of nodes.
>>>> I want to delete all nodes from neo4j having a certain relationship >>>> "rel" except for the nodes whose property "prop" is in the array "arr".
It isn't a good idea to depend on node ids for long term use (rather, use
an email address or guid or similar unique id, with an index). Ids are
reused after you restart the server, I think, if they were deleted.
Wes
On Wed, Nov 7, 2012 at 4:18 PM, divyanshu das <divyanshu....@gmail.com>wrote:
> If I upgrade to 1.8, then I get the delete queries. Now, If I delete the
> nodes, will the node ids for other users remain unchanged or neo4j
> automatically reuses the deleted ids?
> On Thursday, 8 November 2012 02:42:51 UTC+5:30, divyanshu das wrote:
>> Hey, thanks for prompt replies. If I am correct, node(*) method is not
>> available in 1.6.1. Any workaround for this?
>> On Thursday, 8 November 2012 02:40:29 UTC+5:30, Wes Freeman wrote:
>>> I guess that's not exactly what you asked for... how about this:
>>> start n=node(*)
>>> match n-[:rel]->()
>>> where has(n.arr) and not(n.prop in n.arr)
>>> return n;
>>> On Wed, Nov 7, 2012 at 3:54 PM, Wes Freeman <freem...@gmail.com> wrote:
>>>> You can't delete via Cypher with that version of Neo.
>>>> If you want to just find them, you could do something like (I'm not
>>>> entirely sure this worked back then, either--you might consider upgrading):
>>>> start n=node(*)
>>>> where n.prop in n.arr
>>>> return n;
>>>> Wes
>>>> On Wed, Nov 7, 2012 at 3:43 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>> I have neo4j 1.6.1 and I am using php .
>>>>> I have an array "arr" of a particular property "prop" of nodes.
>>>>> I want to delete all nodes from neo4j having a certain relationship
>>>>> "rel" except for the nodes whose property "prop" is in the array "arr".
On Thursday, 8 November 2012 02:56:56 UTC+5:30, Wes Freeman wrote:
> It isn't a good idea to depend on node ids for long term use (rather, use > an email address or guid or similar unique id, with an index). Ids are > reused after you restart the server, I think, if they were deleted.
> Wes
> On Wed, Nov 7, 2012 at 4:18 PM, divyanshu das <divyan...@gmail.com<javascript:> > > wrote:
>> If I upgrade to 1.8, then I get the delete queries. Now, If I delete the >> nodes, will the node ids for other users remain unchanged or neo4j >> automatically reuses the deleted ids?
>> On Thursday, 8 November 2012 02:42:51 UTC+5:30, divyanshu das wrote:
>>> Hey, thanks for prompt replies. If I am correct, node(*) method is not >>> available in 1.6.1. Any workaround for this?
>>> On Thursday, 8 November 2012 02:40:29 UTC+5:30, Wes Freeman wrote:
>>>> I guess that's not exactly what you asked for... how about this:
>>>> start n=node(*) >>>> match n-[:rel]->() >>>> where has(n.arr) and not(n.prop in n.arr) >>>> return n;
>>>> On Wed, Nov 7, 2012 at 3:54 PM, Wes Freeman <freem...@gmail.com> wrote:
>>>>> You can't delete via Cypher with that version of Neo.
>>>>> If you want to just find them, you could do something like (I'm not >>>>> entirely sure this worked back then, either--you might consider upgrading):
>>>>> start n=node(*) >>>>> where n.prop in n.arr >>>>> return n;
>>>>> Wes
>>>>> On Wed, Nov 7, 2012 at 3:43 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>>> I have neo4j 1.6.1 and I am using php .
>>>>>> I have an array "arr" of a particular property "prop" of nodes.
>>>>>> I want to delete all nodes from neo4j having a certain relationship >>>>>> "rel" except for the nodes whose property "prop" is in the array "arr".
> Is there any other way to delete nodes in 1.6.1 without using cypher
> queries?
> On Thursday, 8 November 2012 02:56:56 UTC+5:30, Wes Freeman wrote:
>> It isn't a good idea to depend on node ids for long term use (rather, use
>> an email address or guid or similar unique id, with an index). Ids are
>> reused after you restart the server, I think, if they were deleted.
>> Wes
>> On Wed, Nov 7, 2012 at 4:18 PM, divyanshu das <divyan...@gmail.com>wrote:
>>> If I upgrade to 1.8, then I get the delete queries. Now, If I delete the
>>> nodes, will the node ids for other users remain unchanged or neo4j
>>> automatically reuses the deleted ids?
>>> On Thursday, 8 November 2012 02:42:51 UTC+5:30, divyanshu das wrote:
>>>> Hey, thanks for prompt replies. If I am correct, node(*) method is not
>>>> available in 1.6.1. Any workaround for this?
>>>> On Thursday, 8 November 2012 02:40:29 UTC+5:30, Wes Freeman wrote:
>>>>> I guess that's not exactly what you asked for... how about this:
>>>>> start n=node(*)
>>>>> match n-[:rel]->()
>>>>> where has(n.arr) and not(n.prop in n.arr)
>>>>> return n;
>>>>> On Wed, Nov 7, 2012 at 3:54 PM, Wes Freeman <freem...@gmail.com>wrote:
>>>>>> You can't delete via Cypher with that version of Neo.
>>>>>> If you want to just find them, you could do something like (I'm not
>>>>>> entirely sure this worked back then, either--you might consider upgrading):
>>>>>> start n=node(*)
>>>>>> where n.prop in n.arr
>>>>>> return n;
>>>>>> Wes
>>>>>> On Wed, Nov 7, 2012 at 3:43 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>>>> I have neo4j 1.6.1 and I am using php .
>>>>>>> I have an array "arr" of a particular property "prop" of nodes.
>>>>>>> I want to delete all nodes from neo4j having a certain relationship
>>>>>>> "rel" except for the nodes whose property "prop" is in the array "arr".
> On Wed, Nov 7, 2012 at 4:36 PM, divyanshu das <divyan...@gmail.com<javascript:> > > wrote:
>> Is there any other way to delete nodes in 1.6.1 without using cypher >> queries?
>> On Thursday, 8 November 2012 02:56:56 UTC+5:30, Wes Freeman wrote:
>>> It isn't a good idea to depend on node ids for long term use (rather, >>> use an email address or guid or similar unique id, with an index). Ids are >>> reused after you restart the server, I think, if they were deleted.
>>> Wes
>>> On Wed, Nov 7, 2012 at 4:18 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>> If I upgrade to 1.8, then I get the delete queries. Now, If I delete >>>> the nodes, will the node ids for other users remain unchanged or neo4j >>>> automatically reuses the deleted ids?
>>>> On Thursday, 8 November 2012 02:42:51 UTC+5:30, divyanshu das wrote:
>>>>> Hey, thanks for prompt replies. If I am correct, node(*) method is not >>>>> available in 1.6.1. Any workaround for this?
>>>>> On Thursday, 8 November 2012 02:40:29 UTC+5:30, Wes Freeman wrote:
>>>>>> I guess that's not exactly what you asked for... how about this:
>>>>>> start n=node(*) >>>>>> match n-[:rel]->() >>>>>> where has(n.arr) and not(n.prop in n.arr) >>>>>> return n;
>>>>>> On Wed, Nov 7, 2012 at 3:54 PM, Wes Freeman <freem...@gmail.com>wrote:
>>>>>>> You can't delete via Cypher with that version of Neo.
>>>>>>> If you want to just find them, you could do something like (I'm not >>>>>>> entirely sure this worked back then, either--you might consider upgrading):
>>>>>>> start n=node(*) >>>>>>> where n.prop in n.arr >>>>>>> return n;
>>>>>>> Wes
>>>>>>> On Wed, Nov 7, 2012 at 3:43 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>>>>> I have neo4j 1.6.1 and I am using php .
>>>>>>>> I have an array "arr" of a particular property "prop" of nodes.
>>>>>>>> I want to delete all nodes from neo4j having a certain relationship >>>>>>>> "rel" except for the nodes whose property "prop" is in the array "arr".
You can also specify a literal array in cypher... not sure what you're
using from PHP, but you can do something like this via REST:
{query:"start n=node(*)
match n-[:rel]->()
where not(n.prop in {phparr})
return n;", params:{phparr:[1,2,3]}}
On Thu, Nov 8, 2012 at 11:55 AM, divyanshu das <divyanshu....@gmail.com>wrote:
>> On Wed, Nov 7, 2012 at 4:36 PM, divyanshu das <divyan...@gmail.com>wrote:
>>> Is there any other way to delete nodes in 1.6.1 without using cypher
>>> queries?
>>> On Thursday, 8 November 2012 02:56:56 UTC+5:30, Wes Freeman wrote:
>>>> It isn't a good idea to depend on node ids for long term use (rather,
>>>> use an email address or guid or similar unique id, with an index). Ids are
>>>> reused after you restart the server, I think, if they were deleted.
>>>> Wes
>>>> On Wed, Nov 7, 2012 at 4:18 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>> If I upgrade to 1.8, then I get the delete queries. Now, If I delete
>>>>> the nodes, will the node ids for other users remain unchanged or neo4j
>>>>> automatically reuses the deleted ids?
>>>>> On Thursday, 8 November 2012 02:42:51 UTC+5:30, divyanshu das wrote:
>>>>>> Hey, thanks for prompt replies. If I am correct, node(*) method is
>>>>>> not available in 1.6.1. Any workaround for this?
>>>>>> On Thursday, 8 November 2012 02:40:29 UTC+5:30, Wes Freeman wrote:
>>>>>>> I guess that's not exactly what you asked for... how about this:
>>>>>>> start n=node(*)
>>>>>>> match n-[:rel]->()
>>>>>>> where has(n.arr) and not(n.prop in n.arr)
>>>>>>> return n;
>>>>>>> On Wed, Nov 7, 2012 at 3:54 PM, Wes Freeman <freem...@gmail.com>wrote:
>>>>>>>> You can't delete via Cypher with that version of Neo.
>>>>>>>> If you want to just find them, you could do something like (I'm not
>>>>>>>> entirely sure this worked back then, either--you might consider upgrading):
>>>>>>>> start n=node(*)
>>>>>>>> where n.prop in n.arr
>>>>>>>> return n;
>>>>>>>> Wes
>>>>>>>> On Wed, Nov 7, 2012 at 3:43 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>>>>>> I have neo4j 1.6.1 and I am using php .
>>>>>>>>> I have an array "arr" of a particular property "prop" of nodes.
>>>>>>>>> I want to delete all nodes from neo4j having a certain
>>>>>>>>> relationship "rel" except for the nodes whose property "prop" is in the
>>>>>>>>> array "arr".
On Thursday, 8 November 2012 22:47:42 UTC+5:30, Wes Freeman wrote:
> You can also specify a literal array in cypher... not sure what you're > using from PHP, but you can do something like this via REST: > {query:"start n=node(*) > match n-[:rel]->() > where not(n.prop in {phparr}) > return n;", params:{phparr:[1,2,3]}}
> On Thu, Nov 8, 2012 at 11:55 AM, divyanshu das <divyan...@gmail.com<javascript:> > > wrote:
>> @Freeman, The code that you gave works for array when it is in neo4j.
>> I have a separate php array that I am fetching from mysql.
>> I need to delete the nodes and relationships for nodes whose certain >> property matches the values stored in thee array.
>> On Thursday, 8 November 2012 03:23:19 UTC+5:30, Wes Freeman wrote:
>>> On Wed, Nov 7, 2012 at 4:36 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>> Is there any other way to delete nodes in 1.6.1 without using cypher >>>> queries?
>>>> On Thursday, 8 November 2012 02:56:56 UTC+5:30, Wes Freeman wrote:
>>>>> It isn't a good idea to depend on node ids for long term use (rather, >>>>> use an email address or guid or similar unique id, with an index). Ids are >>>>> reused after you restart the server, I think, if they were deleted.
>>>>> Wes
>>>>> On Wed, Nov 7, 2012 at 4:18 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>>> If I upgrade to 1.8, then I get the delete queries. Now, If I delete >>>>>> the nodes, will the node ids for other users remain unchanged or neo4j >>>>>> automatically reuses the deleted ids?
>>>>>> On Thursday, 8 November 2012 02:42:51 UTC+5:30, divyanshu das wrote:
>>>>>>> Hey, thanks for prompt replies. If I am correct, node(*) method is >>>>>>> not available in 1.6.1. Any workaround for this?
>>>>>>> On Thursday, 8 November 2012 02:40:29 UTC+5:30, Wes Freeman wrote:
>>>>>>>> I guess that's not exactly what you asked for... how about this:
>>>>>>>> start n=node(*) >>>>>>>> match n-[:rel]->() >>>>>>>> where has(n.arr) and not(n.prop in n.arr) >>>>>>>> return n;
>>>>>>>> On Wed, Nov 7, 2012 at 3:54 PM, Wes Freeman <freem...@gmail.com>wrote:
>>>>>>>>> You can't delete via Cypher with that version of Neo.
>>>>>>>>> If you want to just find them, you could do something like (I'm >>>>>>>>> not entirely sure this worked back then, either--you might consider >>>>>>>>> upgrading):
>>>>>>>>> start n=node(*) >>>>>>>>> where n.prop in n.arr >>>>>>>>> return n;
>>>>>>>>> Wes
>>>>>>>>> On Wed, Nov 7, 2012 at 3:43 PM, divyanshu das <divyan...@gmail.com >>>>>>>>> > wrote:
>>>>>>>>>> I have neo4j 1.6.1 and I am using php .
>>>>>>>>>> I have an array "arr" of a particular property "prop" of nodes.
>>>>>>>>>> I want to delete all nodes from neo4j having a certain >>>>>>>>>> relationship "rel" except for the nodes whose property "prop" is in the >>>>>>>>>> array "arr".
I'm assuming it knows how to convert a php array to a json array, but maybe
that's not a good assumption. If it doesn't, you might have to do something
like http://php.net/manual/en/function.json-encode.php to convert your php
array to a json non-associative array.
On Thu, Nov 8, 2012 at 12:25 PM, divyanshu das <divyanshu....@gmail.com>wrote:
> my phparray is $result_array, so will the query look like this?
> $queryTemplate = "START n = node(*) MATCH n-[:rel]->() WHERE not(n.prop in
> {phparr}) Return n", params:{phparra:$result_array};
> On Thursday, 8 November 2012 22:47:42 UTC+5:30, Wes Freeman wrote:
>> You can also specify a literal array in cypher... not sure what you're
>> using from PHP, but you can do something like this via REST:
>> {query:"start n=node(*)
>> match n-[:rel]->()
>> where not(n.prop in {phparr})
>> return n;", params:{phparr:[1,2,3]}}
>> On Thu, Nov 8, 2012 at 11:55 AM, divyanshu das <divyan...@gmail.com>wrote:
>>> @Freeman, The code that you gave works for array when it is in neo4j.
>>> I have a separate php array that I am fetching from mysql.
>>> I need to delete the nodes and relationships for nodes whose certain
>>> property matches the values stored in thee array.
>>> On Thursday, 8 November 2012 03:23:19 UTC+5:30, Wes Freeman wrote:
>>>> On Wed, Nov 7, 2012 at 4:36 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>> Is there any other way to delete nodes in 1.6.1 without using cypher
>>>>> queries?
>>>>> On Thursday, 8 November 2012 02:56:56 UTC+5:30, Wes Freeman wrote:
>>>>>> It isn't a good idea to depend on node ids for long term use (rather,
>>>>>> use an email address or guid or similar unique id, with an index). Ids are
>>>>>> reused after you restart the server, I think, if they were deleted.
>>>>>> Wes
>>>>>> On Wed, Nov 7, 2012 at 4:18 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>>>> If I upgrade to 1.8, then I get the delete queries. Now, If I delete
>>>>>>> the nodes, will the node ids for other users remain unchanged or neo4j
>>>>>>> automatically reuses the deleted ids?
>>>>>>> On Thursday, 8 November 2012 02:42:51 UTC+5:30, divyanshu das wrote:
>>>>>>>> Hey, thanks for prompt replies. If I am correct, node(*) method is
>>>>>>>> not available in 1.6.1. Any workaround for this?
>>>>>>>> On Thursday, 8 November 2012 02:40:29 UTC+5:30, Wes Freeman wrote:
>>>>>>>>> I guess that's not exactly what you asked for... how about this:
>>>>>>>>> start n=node(*)
>>>>>>>>> match n-[:rel]->()
>>>>>>>>> where has(n.arr) and not(n.prop in n.arr)
>>>>>>>>> return n;
>>>>>>>>> On Wed, Nov 7, 2012 at 3:54 PM, Wes Freeman <freem...@gmail.com>wrote:
>>>>>>>>>> You can't delete via Cypher with that version of Neo.
>>>>>>>>>> If you want to just find them, you could do something like (I'm
>>>>>>>>>> not entirely sure this worked back then, either--you might consider
>>>>>>>>>> upgrading):
>>>>>>>>>> start n=node(*)
>>>>>>>>>> where n.prop in n.arr
>>>>>>>>>> return n;
>>>>>>>>>> Wes
>>>>>>>>>> On Wed, Nov 7, 2012 at 3:43 PM, divyanshu das <
>>>>>>>>>> divyan...@gmail.com> wrote:
>>>>>>>>>>> I have neo4j 1.6.1 and I am using php .
>>>>>>>>>>> I have an array "arr" of a particular property "prop" of nodes.
>>>>>>>>>>> I want to delete all nodes from neo4j having a certain
>>>>>>>>>>> relationship "rel" except for the nodes whose property "prop" is in the
>>>>>>>>>>> array "arr".
hey thanks. I saw this example after I posted the last reply.
Now, when i run this query for a particular node "abc" it just returns the the node "abc" multiple times(i guess no. of nodes which are not in that array).
If I run the query with node(*), it fails at node 0. giving the message:- The property 'prop' does not exist on Node[0].
> I'm assuming it knows how to convert a php array to a json array, but > maybe that's not a good assumption. If it doesn't, you might have to do > something like http://php.net/manual/en/function.json-encode.php to > convert your php array to a json non-associative array.
> On Thu, Nov 8, 2012 at 12:25 PM, divyanshu das <divyan...@gmail.com<javascript:> > > wrote:
>> my phparray is $result_array, so will the query look like this?
>> $queryTemplate = "START n = node(*) MATCH n-[:rel]->() WHERE not(n.prop >> in {phparr}) Return n", params:{phparra:$result_array};
>> On Thursday, 8 November 2012 22:47:42 UTC+5:30, Wes Freeman wrote:
>>> You can also specify a literal array in cypher... not sure what you're >>> using from PHP, but you can do something like this via REST: >>> {query:"start n=node(*) >>> match n-[:rel]->() >>> where not(n.prop in {phparr}) >>> return n;", params:{phparr:[1,2,3]}}
>>> On Thu, Nov 8, 2012 at 11:55 AM, divyanshu das <divyan...@gmail.com>wrote:
>>>> @Freeman, The code that you gave works for array when it is in neo4j.
>>>> I have a separate php array that I am fetching from mysql.
>>>> I need to delete the nodes and relationships for nodes whose certain >>>> property matches the values stored in thee array.
>>>> On Thursday, 8 November 2012 03:23:19 UTC+5:30, Wes Freeman wrote:
>>>>> On Wed, Nov 7, 2012 at 4:36 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>>> Is there any other way to delete nodes in 1.6.1 without using cypher >>>>>> queries?
>>>>>> On Thursday, 8 November 2012 02:56:56 UTC+5:30, Wes Freeman wrote:
>>>>>>> It isn't a good idea to depend on node ids for long term use >>>>>>> (rather, use an email address or guid or similar unique id, with an index). >>>>>>> Ids are reused after you restart the server, I think, if they were deleted.
>>>>>>> Wes
>>>>>>> On Wed, Nov 7, 2012 at 4:18 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>>>>> If I upgrade to 1.8, then I get the delete queries. Now, If I >>>>>>>> delete the nodes, will the node ids for other users remain unchanged or >>>>>>>> neo4j automatically reuses the deleted ids?
>>>>>>>> On Thursday, 8 November 2012 02:42:51 UTC+5:30, divyanshu das wrote:
>>>>>>>>> Hey, thanks for prompt replies. If I am correct, node(*) method is >>>>>>>>> not available in 1.6.1. Any workaround for this?
>>>>>>>>> On Thursday, 8 November 2012 02:40:29 UTC+5:30, Wes Freeman wrote:
>>>>>>>>>> I guess that's not exactly what you asked for... how about this:
>>>>>>>>>> start n=node(*) >>>>>>>>>> match n-[:rel]->() >>>>>>>>>> where has(n.arr) and not(n.prop in n.arr) >>>>>>>>>> return n;
>>>>>>>>>> On Wed, Nov 7, 2012 at 3:54 PM, Wes Freeman <freem...@gmail.com>wrote:
>>>>>>>>>>> You can't delete via Cypher with that version of Neo.
>>>>>>>>>>> If you want to just find them, you could do something like (I'm >>>>>>>>>>> not entirely sure this worked back then, either--you might consider >>>>>>>>>>> upgrading):
>>>>>>>>>>> start n=node(*) >>>>>>>>>>> where n.prop in n.arr >>>>>>>>>>> return n;
>>>>>>>>>>> Wes
>>>>>>>>>>> On Wed, Nov 7, 2012 at 3:43 PM, divyanshu das < >>>>>>>>>>> divyan...@gmail.com> wrote:
>>>>>>>>>>>> I have neo4j 1.6.1 and I am using php .
>>>>>>>>>>>> I have an array "arr" of a particular property "prop" of nodes.
>>>>>>>>>>>> I want to delete all nodes from neo4j having a certain >>>>>>>>>>>> relationship "rel" except for the nodes whose property "prop" is in the >>>>>>>>>>>> array "arr".
On Thursday, 8 November 2012 23:30:19 UTC+5:30, divyanshu das wrote:
> hey thanks. I saw this example after I posted the last reply.
> Now, when i run this query for a particular node "abc" it just returns the > the node "abc" multiple times(i guess no. of nodes which are not in that > array).
> If I run the query with node(*), it fails at node 0. giving the message:- The > property 'prop' does not exist on Node[0].
> How do I skip checking at node 0.
> On Thursday, 8 November 2012 23:10:07 UTC+5:30, Wes Freeman wrote:
>> They have an example there with a parameter using the constructor...
>> I'm assuming it knows how to convert a php array to a json array, but >> maybe that's not a good assumption. If it doesn't, you might have to do >> something like http://php.net/manual/en/function.json-encode.php to >> convert your php array to a json non-associative array.
>> On Thu, Nov 8, 2012 at 12:25 PM, divyanshu das <divyan...@gmail.com>wrote:
>>> my phparray is $result_array, so will the query look like this?
>>> $queryTemplate = "START n = node(*) MATCH n-[:rel]->() WHERE not(n.prop >>> in {phparr}) Return n", params:{phparra:$result_array};
>>> On Thursday, 8 November 2012 22:47:42 UTC+5:30, Wes Freeman wrote:
>>>> You can also specify a literal array in cypher... not sure what you're >>>> using from PHP, but you can do something like this via REST: >>>> {query:"start n=node(*) >>>> match n-[:rel]->() >>>> where not(n.prop in {phparr}) >>>> return n;", params:{phparr:[1,2,3]}}
>>>> On Thu, Nov 8, 2012 at 11:55 AM, divyanshu das <divyan...@gmail.com>wrote:
>>>>> @Freeman, The code that you gave works for array when it is in neo4j.
>>>>> I have a separate php array that I am fetching from mysql.
>>>>> I need to delete the nodes and relationships for nodes whose certain >>>>> property matches the values stored in thee array.
>>>>> On Thursday, 8 November 2012 03:23:19 UTC+5:30, Wes Freeman wrote:
>>>>>> On Wed, Nov 7, 2012 at 4:36 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>>>> Is there any other way to delete nodes in 1.6.1 without using cypher >>>>>>> queries?
>>>>>>> On Thursday, 8 November 2012 02:56:56 UTC+5:30, Wes Freeman wrote:
>>>>>>>> It isn't a good idea to depend on node ids for long term use >>>>>>>> (rather, use an email address or guid or similar unique id, with an index). >>>>>>>> Ids are reused after you restart the server, I think, if they were deleted.
>>>>>>>> Wes
>>>>>>>> On Wed, Nov 7, 2012 at 4:18 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>>>>>> If I upgrade to 1.8, then I get the delete queries. Now, If I >>>>>>>>> delete the nodes, will the node ids for other users remain unchanged or >>>>>>>>> neo4j automatically reuses the deleted ids?
>>>>>>>>> On Thursday, 8 November 2012 02:42:51 UTC+5:30, divyanshu das >>>>>>>>> wrote:
>>>>>>>>>> Hey, thanks for prompt replies. If I am correct, node(*) method >>>>>>>>>> is not available in 1.6.1. Any workaround for this?
>>>>>>>>>> On Thursday, 8 November 2012 02:40:29 UTC+5:30, Wes Freeman wrote:
>>>>>>>>>>> I guess that's not exactly what you asked for... how about this:
>>>>>>>>>>> start n=node(*) >>>>>>>>>>> match n-[:rel]->() >>>>>>>>>>> where has(n.arr) and not(n.prop in n.arr) >>>>>>>>>>> return n;
>>>>>>>>>>> On Wed, Nov 7, 2012 at 3:54 PM, Wes Freeman <freem...@gmail.com>wrote:
>>>>>>>>>>>> You can't delete via Cypher with that version of Neo.
>>>>>>>>>>>> If you want to just find them, you could do something like (I'm >>>>>>>>>>>> not entirely sure this worked back then, either--you might consider >>>>>>>>>>>> upgrading):
>>>>>>>>>>>> start n=node(*) >>>>>>>>>>>> where n.prop in n.arr >>>>>>>>>>>> return n;
>>>>>>>>>>>> Wes
>>>>>>>>>>>> On Wed, Nov 7, 2012 at 3:43 PM, divyanshu das < >>>>>>>>>>>> divyan...@gmail.com> wrote:
>>>>>>>>>>>>> I have neo4j 1.6.1 and I am using php .
>>>>>>>>>>>>> I have an array "arr" of a particular property "prop" of nodes.
>>>>>>>>>>>>> I want to delete all nodes from neo4j having a certain >>>>>>>>>>>>> relationship "rel" except for the nodes whose property "prop" is in the >>>>>>>>>>>>> array "arr".
On Thursday, 8 November 2012 23:37:03 UTC+5:30, divyanshu das wrote:
> I modified to query like this:-
> WHERE has(n,prop) AND not(n.prop in {phparr})
> On Thursday, 8 November 2012 23:30:19 UTC+5:30, divyanshu das wrote:
>> hey thanks. I saw this example after I posted the last reply.
>> Now, when i run this query for a particular node "abc" it just returns >> the the node "abc" multiple times(i guess no. of nodes which are not in >> that array).
>> If I run the query with node(*), it fails at node 0. giving the message:- The >> property 'prop' does not exist on Node[0].
>> How do I skip checking at node 0.
>> On Thursday, 8 November 2012 23:10:07 UTC+5:30, Wes Freeman wrote:
>>> They have an example there with a parameter using the constructor...
>>> I'm assuming it knows how to convert a php array to a json array, but >>> maybe that's not a good assumption. If it doesn't, you might have to do >>> something like http://php.net/manual/en/function.json-encode.php to >>> convert your php array to a json non-associative array.
>>> On Thu, Nov 8, 2012 at 12:25 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>> my phparray is $result_array, so will the query look like this?
>>>> $queryTemplate = "START n = node(*) MATCH n-[:rel]->() WHERE not(n.prop >>>> in {phparr}) Return n", params:{phparra:$result_array};
>>>> On Thursday, 8 November 2012 22:47:42 UTC+5:30, Wes Freeman wrote:
>>>>> You can also specify a literal array in cypher... not sure what you're >>>>> using from PHP, but you can do something like this via REST: >>>>> {query:"start n=node(*) >>>>> match n-[:rel]->() >>>>> where not(n.prop in {phparr}) >>>>> return n;", params:{phparr:[1,2,3]}}
>>>>> On Thu, Nov 8, 2012 at 11:55 AM, divyanshu das <divyan...@gmail.com>wrote:
>>>>>> @Freeman, The code that you gave works for array when it is in neo4j.
>>>>>> I have a separate php array that I am fetching from mysql.
>>>>>> I need to delete the nodes and relationships for nodes whose certain >>>>>> property matches the values stored in thee array.
>>>>>> On Thursday, 8 November 2012 03:23:19 UTC+5:30, Wes Freeman wrote:
>>>>>>> On Wed, Nov 7, 2012 at 4:36 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>>>>> Is there any other way to delete nodes in 1.6.1 without using >>>>>>>> cypher queries?
>>>>>>>> On Thursday, 8 November 2012 02:56:56 UTC+5:30, Wes Freeman wrote:
>>>>>>>>> It isn't a good idea to depend on node ids for long term use >>>>>>>>> (rather, use an email address or guid or similar unique id, with an index). >>>>>>>>> Ids are reused after you restart the server, I think, if they were deleted.
>>>>>>>>> Wes
>>>>>>>>> On Wed, Nov 7, 2012 at 4:18 PM, divyanshu das <divyan...@gmail.com >>>>>>>>> > wrote:
>>>>>>>>>> If I upgrade to 1.8, then I get the delete queries. Now, If I >>>>>>>>>> delete the nodes, will the node ids for other users remain unchanged or >>>>>>>>>> neo4j automatically reuses the deleted ids?
>>>>>>>>>> On Thursday, 8 November 2012 02:42:51 UTC+5:30, divyanshu das >>>>>>>>>> wrote:
>>>>>>>>>>> Hey, thanks for prompt replies. If I am correct, node(*) method >>>>>>>>>>> is not available in 1.6.1. Any workaround for this?
>>>>>>>>>>> On Thursday, 8 November 2012 02:40:29 UTC+5:30, Wes Freeman >>>>>>>>>>> wrote:
>>>>>>>>>>>> I guess that's not exactly what you asked for... how about this:
>>>>>>>>>>>> start n=node(*) >>>>>>>>>>>> match n-[:rel]->() >>>>>>>>>>>> where has(n.arr) and not(n.prop in n.arr) >>>>>>>>>>>> return n;
>>>>>>>>>>>> On Wed, Nov 7, 2012 at 3:54 PM, Wes Freeman <freem...@gmail.com >>>>>>>>>>>> > wrote:
>>>>>>>>>>>>> You can't delete via Cypher with that version of Neo.
>>>>>>>>>>>>> If you want to just find them, you could do something like >>>>>>>>>>>>> (I'm not entirely sure this worked back then, either--you might consider >>>>>>>>>>>>> upgrading):
>>>>>>>>>>>>> start n=node(*) >>>>>>>>>>>>> where n.prop in n.arr >>>>>>>>>>>>> return n;
>>>>>>>>>>>>> Wes
>>>>>>>>>>>>> On Wed, Nov 7, 2012 at 3:43 PM, divyanshu das < >>>>>>>>>>>>> divyan...@gmail.com> wrote:
>>>>>>>>>>>>>> I have neo4j 1.6.1 and I am using php .
>>>>>>>>>>>>>> I have an array "arr" of a particular property "prop" of >>>>>>>>>>>>>> nodes.
>>>>>>>>>>>>>> I want to delete all nodes from neo4j having a certain >>>>>>>>>>>>>> relationship "rel" except for the nodes whose property "prop" is in the >>>>>>>>>>>>>> array "arr".
>>>>>>>>>>>>>> Can somebody help me out with this?
Just want to jump in here. The current workaround for deleting indexed
nodes with Cypher requires you to know what indexes the node is indexed in,
and for which property keys and values it is indexed. You can then delete
the node, and then look it up in all indexes where it was previously
indexed. This will not return any results, but it will trigger the
necessary cleanup of the index.
David
On Wed, Nov 7, 2012 at 1:36 PM, divyanshu das <divyanshu....@gmail.com>wrote:
> Is there any other way to delete nodes in 1.6.1 without using cypher
> queries?
> On Thursday, 8 November 2012 02:56:56 UTC+5:30, Wes Freeman wrote:
>> It isn't a good idea to depend on node ids for long term use (rather, use
>> an email address or guid or similar unique id, with an index). Ids are
>> reused after you restart the server, I think, if they were deleted.
>> Wes
>> On Wed, Nov 7, 2012 at 4:18 PM, divyanshu das <divyan...@gmail.com>wrote:
>>> If I upgrade to 1.8, then I get the delete queries. Now, If I delete the
>>> nodes, will the node ids for other users remain unchanged or neo4j
>>> automatically reuses the deleted ids?
>>> On Thursday, 8 November 2012 02:42:51 UTC+5:30, divyanshu das wrote:
>>>> Hey, thanks for prompt replies. If I am correct, node(*) method is not
>>>> available in 1.6.1. Any workaround for this?
>>>> On Thursday, 8 November 2012 02:40:29 UTC+5:30, Wes Freeman wrote:
>>>>> I guess that's not exactly what you asked for... how about this:
>>>>> start n=node(*)
>>>>> match n-[:rel]->()
>>>>> where has(n.arr) and not(n.prop in n.arr)
>>>>> return n;
>>>>> On Wed, Nov 7, 2012 at 3:54 PM, Wes Freeman <freem...@gmail.com>wrote:
>>>>>> You can't delete via Cypher with that version of Neo.
>>>>>> If you want to just find them, you could do something like (I'm not
>>>>>> entirely sure this worked back then, either--you might consider upgrading):
>>>>>> start n=node(*)
>>>>>> where n.prop in n.arr
>>>>>> return n;
>>>>>> Wes
>>>>>> On Wed, Nov 7, 2012 at 3:43 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>>>> I have neo4j 1.6.1 and I am using php .
>>>>>>> I have an array "arr" of a particular property "prop" of nodes.
>>>>>>> I want to delete all nodes from neo4j having a certain relationship
>>>>>>> "rel" except for the nodes whose property "prop" is in the array "arr".
On Friday, 9 November 2012 00:03:03 UTC+5:30, David Montag wrote:
> Just want to jump in here. The current workaround for deleting indexed > nodes with Cypher requires you to know what indexes the node is indexed in, > and for which property keys and values it is indexed. You can then delete > the node, and then look it up in all indexes where it was previously > indexed. This will not return any results, but it will trigger the > necessary cleanup of the index.
> David
> On Wed, Nov 7, 2012 at 1:36 PM, divyanshu das <divyan...@gmail.com<javascript:> > > wrote:
>> Is there any other way to delete nodes in 1.6.1 without using cypher >> queries?
>> On Thursday, 8 November 2012 02:56:56 UTC+5:30, Wes Freeman wrote:
>>> It isn't a good idea to depend on node ids for long term use (rather, >>> use an email address or guid or similar unique id, with an index). Ids are >>> reused after you restart the server, I think, if they were deleted.
>>> Wes
>>> On Wed, Nov 7, 2012 at 4:18 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>> If I upgrade to 1.8, then I get the delete queries. Now, If I delete >>>> the nodes, will the node ids for other users remain unchanged or neo4j >>>> automatically reuses the deleted ids?
>>>> On Thursday, 8 November 2012 02:42:51 UTC+5:30, divyanshu das wrote:
>>>>> Hey, thanks for prompt replies. If I am correct, node(*) method is not >>>>> available in 1.6.1. Any workaround for this?
>>>>> On Thursday, 8 November 2012 02:40:29 UTC+5:30, Wes Freeman wrote:
>>>>>> I guess that's not exactly what you asked for... how about this:
>>>>>> start n=node(*) >>>>>> match n-[:rel]->() >>>>>> where has(n.arr) and not(n.prop in n.arr) >>>>>> return n;
>>>>>> On Wed, Nov 7, 2012 at 3:54 PM, Wes Freeman <freem...@gmail.com>wrote:
>>>>>>> You can't delete via Cypher with that version of Neo.
>>>>>>> If you want to just find them, you could do something like (I'm not >>>>>>> entirely sure this worked back then, either--you might consider upgrading):
>>>>>>> start n=node(*) >>>>>>> where n.prop in n.arr >>>>>>> return n;
>>>>>>> Wes
>>>>>>> On Wed, Nov 7, 2012 at 3:43 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>>>>> I have neo4j 1.6.1 and I am using php .
>>>>>>>> I have an array "arr" of a particular property "prop" of nodes.
>>>>>>>> I want to delete all nodes from neo4j having a certain relationship >>>>>>>> "rel" except for the nodes whose property "prop" is in the array "arr".
> hey thanks. I saw this example after I posted the last reply.
> Now, when i run this query for a particular node "abc" it just returns the
> the node "abc" multiple times(i guess no. of nodes which are not in that
> array).
> If I run the query with node(*), it fails at node 0. giving the message:- The
> property 'prop' does not exist on Node[0].
> How do I skip checking at node 0.
> On Thursday, 8 November 2012 23:10:07 UTC+5:30, Wes Freeman wrote:
>> They have an example there with a parameter using the constructor...
>>> my phparray is $result_array, so will the query look like this?
>>> $queryTemplate = "START n = node(*) MATCH n-[:rel]->() WHERE not(n.prop
>>> in {phparr}) Return n", params:{phparra:$result_array}**;
>>> On Thursday, 8 November 2012 22:47:42 UTC+5:30, Wes Freeman wrote:
>>>> You can also specify a literal array in cypher... not sure what you're
>>>> using from PHP, but you can do something like this via REST:
>>>> {query:"start n=node(*)
>>>> match n-[:rel]->()
>>>> where not(n.prop in {phparr})
>>>> return n;", params:{phparr:[1,2,3]}}
>>>> On Thu, Nov 8, 2012 at 11:55 AM, divyanshu das <divyan...@gmail.com>wrote:
>>>>> @Freeman, The code that you gave works for array when it is in neo4j.
>>>>> I have a separate php array that I am fetching from mysql.
>>>>> I need to delete the nodes and relationships for nodes whose certain
>>>>> property matches the values stored in thee array.
>>>>> On Thursday, 8 November 2012 03:23:19 UTC+5:30, Wes Freeman wrote:
>>>>>> On Wed, Nov 7, 2012 at 4:36 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>>>> Is there any other way to delete nodes in 1.6.1 without using cypher
>>>>>>> queries?
>>>>>>> On Thursday, 8 November 2012 02:56:56 UTC+5:30, Wes Freeman wrote:
>>>>>>>> It isn't a good idea to depend on node ids for long term use
>>>>>>>> (rather, use an email address or guid or similar unique id, with an index).
>>>>>>>> Ids are reused after you restart the server, I think, if they were deleted.
>>>>>>>> Wes
>>>>>>>> On Wed, Nov 7, 2012 at 4:18 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>>>>>> If I upgrade to 1.8, then I get the delete queries. Now, If I
>>>>>>>>> delete the nodes, will the node ids for other users remain unchanged or
>>>>>>>>> neo4j automatically reuses the deleted ids?
>>>>>>>>> On Thursday, 8 November 2012 02:42:51 UTC+5:30, divyanshu das
>>>>>>>>> wrote:
>>>>>>>>>> Hey, thanks for prompt replies. If I am correct, node(*) method
>>>>>>>>>> is not available in 1.6.1. Any workaround for this?
>>>>>>>>>> On Thursday, 8 November 2012 02:40:29 UTC+5:30, Wes Freeman wrote:
>>>>>>>>>>> I guess that's not exactly what you asked for... how about this:
>>>>>>>>>>> start n=node(*)
>>>>>>>>>>> match n-[:rel]->()
>>>>>>>>>>> where has(n.arr) and not(n.prop in n.arr)
>>>>>>>>>>> return n;
>>>>>>>>>>> On Wed, Nov 7, 2012 at 3:54 PM, Wes Freeman <freem...@gmail.com>wrote:
>>>>>>>>>>>> You can't delete via Cypher with that version of Neo.
>>>>>>>>>>>> If you want to just find them, you could do something like (I'm
>>>>>>>>>>>> not entirely sure this worked back then, either--you might consider
>>>>>>>>>>>> upgrading):
>>>>>>>>>>>> start n=node(*)
>>>>>>>>>>>> where n.prop in n.arr
>>>>>>>>>>>> return n;
>>>>>>>>>>>> Wes
>>>>>>>>>>>> On Wed, Nov 7, 2012 at 3:43 PM, divyanshu das <
>>>>>>>>>>>> divyan...@gmail.com> wrote:
>>>>>>>>>>>>> I have neo4j 1.6.1 and I am using php .
>>>>>>>>>>>>> I have an array "arr" of a particular property "prop" of nodes.
>>>>>>>>>>>>> I want to delete all nodes from neo4j having a certain
>>>>>>>>>>>>> relationship "rel" except for the nodes whose property "prop" is in the
>>>>>>>>>>>>> array "arr".
It will. David is just saying (in response to the question about how to
delete in cypher, earlier in the thread) that if you have indexes on those
nodes (do you?), you should query the indexes on the particular fields that
are indexed so the indexes get cleaned up, afterward. You also need to
delete the relationships connected to those nodes at the same time (else
you'll get an error about not being able to delete nodes with
relationships), so you might end up with something like "match n-[r?]-()
... delete n,r;"
I'm not sure what the PHP error is coming from--I'm not much of a PHP guy,
myself. Is this a single command that's failing after 10 minutes, or are
you iterating through some list of arrays and it's failing on one of the
particular arrays?
On Thu, Nov 8, 2012 at 1:42 PM, divyanshu das <divyanshu....@gmail.com>wrote:
> thnx for pointing this out. But I did not quite understand it. Does this
> mean, that if I replace "return" by "delete" it wont delete the nodes?
> However, right now, I want to return those nodes first so that I can
> check if I am actually deleting the right node.
> On Friday, 9 November 2012 00:03:03 UTC+5:30, David Montag wrote:
>> Just want to jump in here. The current workaround for deleting indexed
>> nodes with Cypher requires you to know what indexes the node is indexed in,
>> and for which property keys and values it is indexed. You can then delete
>> the node, and then look it up in all indexes where it was previously
>> indexed. This will not return any results, but it will trigger the
>> necessary cleanup of the index.
>> David
>> On Wed, Nov 7, 2012 at 1:36 PM, divyanshu das <divyan...@gmail.com>wrote:
>>> Is there any other way to delete nodes in 1.6.1 without using cypher
>>> queries?
>>> On Thursday, 8 November 2012 02:56:56 UTC+5:30, Wes Freeman wrote:
>>>> It isn't a good idea to depend on node ids for long term use (rather,
>>>> use an email address or guid or similar unique id, with an index). Ids are
>>>> reused after you restart the server, I think, if they were deleted.
>>>> Wes
>>>> On Wed, Nov 7, 2012 at 4:18 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>> If I upgrade to 1.8, then I get the delete queries. Now, If I delete
>>>>> the nodes, will the node ids for other users remain unchanged or neo4j
>>>>> automatically reuses the deleted ids?
>>>>> On Thursday, 8 November 2012 02:42:51 UTC+5:30, divyanshu das wrote:
>>>>>> Hey, thanks for prompt replies. If I am correct, node(*) method is
>>>>>> not available in 1.6.1. Any workaround for this?
>>>>>> On Thursday, 8 November 2012 02:40:29 UTC+5:30, Wes Freeman wrote:
>>>>>>> I guess that's not exactly what you asked for... how about this:
>>>>>>> start n=node(*)
>>>>>>> match n-[:rel]->()
>>>>>>> where has(n.arr) and not(n.prop in n.arr)
>>>>>>> return n;
>>>>>>> On Wed, Nov 7, 2012 at 3:54 PM, Wes Freeman <freem...@gmail.com>wrote:
>>>>>>>> You can't delete via Cypher with that version of Neo.
>>>>>>>> If you want to just find them, you could do something like (I'm not
>>>>>>>> entirely sure this worked back then, either--you might consider upgrading):
>>>>>>>> start n=node(*)
>>>>>>>> where n.prop in n.arr
>>>>>>>> return n;
>>>>>>>> Wes
>>>>>>>> On Wed, Nov 7, 2012 at 3:43 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>>>>>> I have neo4j 1.6.1 and I am using php .
>>>>>>>>> I have an array "arr" of a particular property "prop" of nodes.
>>>>>>>>> I want to delete all nodes from neo4j having a certain
>>>>>>>>> relationship "rel" except for the nodes whose property "prop" is in the
>>>>>>>>> array "arr".
this is the query I am using:- $queryTemplate = "START n = node(*) MATCH n-[:rel]->b WHERE has(n.prop) AND not(b.prop in {phparr}) RETURN b"; phparr is one single array.
Ideally this query should return all the list of nodes "b" , which has a "rel" relationship and b.prop is not an element of array. But it gives the error I pasted earlier
If I use this query:- $queryTemplate = "START n = node(1239147) MATCH n-[:rel]->b WHERE (n.prop in {phparr}) RETURN b";
I get nodes with b.prop in the array.
But when I use this query with a "not" in where clause it gives no results. I have tried it with 10 nodes. everytime zero results.
My db has 6 million nodes, and 1645 have property "prop"
On Friday, 9 November 2012 01:21:33 UTC+5:30, Wes Freeman wrote:
> It will. David is just saying (in response to the question about how to > delete in cypher, earlier in the thread) that if you have indexes on those > nodes (do you?), you should query the indexes on the particular fields that > are indexed so the indexes get cleaned up, afterward. You also need to > delete the relationships connected to those nodes at the same time (else > you'll get an error about not being able to delete nodes with > relationships), so you might end up with something like "match n-[r?]-() > ... delete n,r;"
> I'm not sure what the PHP error is coming from--I'm not much of a PHP guy, > myself. Is this a single command that's failing after 10 minutes, or are > you iterating through some list of arrays and it's failing on one of the > particular arrays?
> On Thu, Nov 8, 2012 at 1:42 PM, divyanshu das <divyan...@gmail.com<javascript:> > > wrote:
>> thnx for pointing this out. But I did not quite understand it. Does this >> mean, that if I replace "return" by "delete" it wont delete the nodes?
>> However, right now, I want to return those nodes first so that I can >> check if I am actually deleting the right node.
>> On Friday, 9 November 2012 00:03:03 UTC+5:30, David Montag wrote:
>>> Just want to jump in here. The current workaround for deleting indexed >>> nodes with Cypher requires you to know what indexes the node is indexed in, >>> and for which property keys and values it is indexed. You can then delete >>> the node, and then look it up in all indexes where it was previously >>> indexed. This will not return any results, but it will trigger the >>> necessary cleanup of the index.
>>> David
>>> On Wed, Nov 7, 2012 at 1:36 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>> Is there any other way to delete nodes in 1.6.1 without using cypher >>>> queries?
>>>> On Thursday, 8 November 2012 02:56:56 UTC+5:30, Wes Freeman wrote:
>>>>> It isn't a good idea to depend on node ids for long term use (rather, >>>>> use an email address or guid or similar unique id, with an index). Ids are >>>>> reused after you restart the server, I think, if they were deleted.
>>>>> Wes
>>>>> On Wed, Nov 7, 2012 at 4:18 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>>> If I upgrade to 1.8, then I get the delete queries. Now, If I delete >>>>>> the nodes, will the node ids for other users remain unchanged or neo4j >>>>>> automatically reuses the deleted ids?
>>>>>> On Thursday, 8 November 2012 02:42:51 UTC+5:30, divyanshu das wrote:
>>>>>>> Hey, thanks for prompt replies. If I am correct, node(*) method is >>>>>>> not available in 1.6.1. Any workaround for this?
>>>>>>> On Thursday, 8 November 2012 02:40:29 UTC+5:30, Wes Freeman wrote:
>>>>>>>> I guess that's not exactly what you asked for... how about this:
>>>>>>>> start n=node(*) >>>>>>>> match n-[:rel]->() >>>>>>>> where has(n.arr) and not(n.prop in n.arr) >>>>>>>> return n;
>>>>>>>> On Wed, Nov 7, 2012 at 3:54 PM, Wes Freeman <freem...@gmail.com>wrote:
>>>>>>>>> You can't delete via Cypher with that version of Neo.
>>>>>>>>> If you want to just find them, you could do something like (I'm >>>>>>>>> not entirely sure this worked back then, either--you might consider >>>>>>>>> upgrading):
>>>>>>>>> start n=node(*) >>>>>>>>> where n.prop in n.arr >>>>>>>>> return n;
>>>>>>>>> Wes
>>>>>>>>> On Wed, Nov 7, 2012 at 3:43 PM, divyanshu das <divyan...@gmail.com >>>>>>>>> > wrote:
>>>>>>>>>> I have neo4j 1.6.1 and I am using php .
>>>>>>>>>> I have an array "arr" of a particular property "prop" of nodes.
>>>>>>>>>> I want to delete all nodes from neo4j having a certain >>>>>>>>>> relationship "rel" except for the nodes whose property "prop" is in the >>>>>>>>>> array "arr".
> this is the query I am using:- $queryTemplate = "START n = node(*) MATCH
> n-[:rel]->b WHERE has(n.prop) AND not(b.prop in {phparr}) RETURN b";
> phparr is one single array.
> Ideally this query should return all the list of nodes "b" , which has a
> "rel" relationship and b.prop is not an element of array.
> But it gives the error I pasted earlier
> If I use this query:- $queryTemplate = "START n = node(1239147) MATCH
> n-[:rel]->b WHERE (n.prop in {phparr}) RETURN b";
> I get nodes with b.prop in the array.
> But when I use this query with a "not" in where clause it gives no
> results. I have tried it with 10 nodes. everytime zero results.
> My db has 6 million nodes, and 1645 have property "prop"
> On Friday, 9 November 2012 01:21:33 UTC+5:30, Wes Freeman wrote:
>> It will. David is just saying (in response to the question about how to
>> delete in cypher, earlier in the thread) that if you have indexes on those
>> nodes (do you?), you should query the indexes on the particular fields that
>> are indexed so the indexes get cleaned up, afterward. You also need to
>> delete the relationships connected to those nodes at the same time (else
>> you'll get an error about not being able to delete nodes with
>> relationships), so you might end up with something like "match n-[r?]-()
>> ... delete n,r;"
>> I'm not sure what the PHP error is coming from--I'm not much of a PHP
>> guy, myself. Is this a single command that's failing after 10 minutes, or
>> are you iterating through some list of arrays and it's failing on one of
>> the particular arrays?
>> On Thu, Nov 8, 2012 at 1:42 PM, divyanshu das <divyan...@gmail.com>wrote:
>>> thnx for pointing this out. But I did not quite understand it. Does this
>>> mean, that if I replace "return" by "delete" it wont delete the nodes?
>>> However, right now, I want to return those nodes first so that I can
>>> check if I am actually deleting the right node.
>>> On Friday, 9 November 2012 00:03:03 UTC+5:30, David Montag wrote:
>>>> Just want to jump in here. The current workaround for deleting indexed
>>>> nodes with Cypher requires you to know what indexes the node is indexed in,
>>>> and for which property keys and values it is indexed. You can then delete
>>>> the node, and then look it up in all indexes where it was previously
>>>> indexed. This will not return any results, but it will trigger the
>>>> necessary cleanup of the index.
>>>> David
>>>> On Wed, Nov 7, 2012 at 1:36 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>> Is there any other way to delete nodes in 1.6.1 without using cypher
>>>>> queries?
>>>>> On Thursday, 8 November 2012 02:56:56 UTC+5:30, Wes Freeman wrote:
>>>>>> It isn't a good idea to depend on node ids for long term use (rather,
>>>>>> use an email address or guid or similar unique id, with an index). Ids are
>>>>>> reused after you restart the server, I think, if they were deleted.
>>>>>> Wes
>>>>>> On Wed, Nov 7, 2012 at 4:18 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>>>> If I upgrade to 1.8, then I get the delete queries. Now, If I delete
>>>>>>> the nodes, will the node ids for other users remain unchanged or neo4j
>>>>>>> automatically reuses the deleted ids?
>>>>>>> On Thursday, 8 November 2012 02:42:51 UTC+5:30, divyanshu das wrote:
>>>>>>>> Hey, thanks for prompt replies. If I am correct, node(*) method is
>>>>>>>> not available in 1.6.1. Any workaround for this?
>>>>>>>> On Thursday, 8 November 2012 02:40:29 UTC+5:30, Wes Freeman wrote:
>>>>>>>>> I guess that's not exactly what you asked for... how about this:
>>>>>>>>> start n=node(*)
>>>>>>>>> match n-[:rel]->()
>>>>>>>>> where has(n.arr) and not(n.prop in n.arr)
>>>>>>>>> return n;
>>>>>>>>> On Wed, Nov 7, 2012 at 3:54 PM, Wes Freeman <freem...@gmail.com>wrote:
>>>>>>>>>> You can't delete via Cypher with that version of Neo.
>>>>>>>>>> If you want to just find them, you could do something like (I'm
>>>>>>>>>> not entirely sure this worked back then, either--you might consider
>>>>>>>>>> upgrading):
>>>>>>>>>> start n=node(*)
>>>>>>>>>> where n.prop in n.arr
>>>>>>>>>> return n;
>>>>>>>>>> Wes
>>>>>>>>>> On Wed, Nov 7, 2012 at 3:43 PM, divyanshu das <
>>>>>>>>>> divyan...@gmail.com> wrote:
>>>>>>>>>>> I have neo4j 1.6.1 and I am using php .
>>>>>>>>>>> I have an array "arr" of a particular property "prop" of nodes.
>>>>>>>>>>> I want to delete all nodes from neo4j having a certain
>>>>>>>>>>> relationship "rel" except for the nodes whose property "prop" is in the
>>>>>>>>>>> array "arr".
db has 6 million nodes more than 2-3 millions have "prop" property. I need to delete all those nodes with "prop" property and "rel" relationship whose "prop" is not listed in phparr.
On Friday, 9 November 2012 01:49:18 UTC+5:30, divyanshu das wrote:
> Yes, I do have indexes.
> this is the query I am using:- $queryTemplate = "START n = node(*) MATCH > n-[:rel]->b WHERE has(n.prop) AND not(b.prop in {phparr}) RETURN b"; > phparr is one single array.
> Ideally this query should return all the list of nodes "b" , which has a > "rel" relationship and b.prop is not an element of array. > But it gives the error I pasted earlier
> If I use this query:- $queryTemplate = "START n = node(1239147) MATCH > n-[:rel]->b WHERE (n.prop in {phparr}) RETURN b";
> I get nodes with b.prop in the array.
> But when I use this query with a "not" in where clause it gives no > results. I have tried it with 10 nodes. everytime zero results.
> My db has 6 million nodes, and 1645 have property "prop"
> On Friday, 9 November 2012 01:21:33 UTC+5:30, Wes Freeman wrote:
>> It will. David is just saying (in response to the question about how to >> delete in cypher, earlier in the thread) that if you have indexes on those >> nodes (do you?), you should query the indexes on the particular fields that >> are indexed so the indexes get cleaned up, afterward. You also need to >> delete the relationships connected to those nodes at the same time (else >> you'll get an error about not being able to delete nodes with >> relationships), so you might end up with something like "match n-[r?]-() >> ... delete n,r;"
>> I'm not sure what the PHP error is coming from--I'm not much of a PHP >> guy, myself. Is this a single command that's failing after 10 minutes, or >> are you iterating through some list of arrays and it's failing on one of >> the particular arrays?
>> On Thu, Nov 8, 2012 at 1:42 PM, divyanshu das <divyan...@gmail.com>wrote:
>>> thnx for pointing this out. But I did not quite understand it. Does this >>> mean, that if I replace "return" by "delete" it wont delete the nodes?
>>> However, right now, I want to return those nodes first so that I can >>> check if I am actually deleting the right node.
>>> On Friday, 9 November 2012 00:03:03 UTC+5:30, David Montag wrote:
>>>> Just want to jump in here. The current workaround for deleting indexed >>>> nodes with Cypher requires you to know what indexes the node is indexed in, >>>> and for which property keys and values it is indexed. You can then delete >>>> the node, and then look it up in all indexes where it was previously >>>> indexed. This will not return any results, but it will trigger the >>>> necessary cleanup of the index.
>>>> David
>>>> On Wed, Nov 7, 2012 at 1:36 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>> Is there any other way to delete nodes in 1.6.1 without using cypher >>>>> queries?
>>>>> On Thursday, 8 November 2012 02:56:56 UTC+5:30, Wes Freeman wrote:
>>>>>> It isn't a good idea to depend on node ids for long term use (rather, >>>>>> use an email address or guid or similar unique id, with an index). Ids are >>>>>> reused after you restart the server, I think, if they were deleted.
>>>>>> Wes
>>>>>> On Wed, Nov 7, 2012 at 4:18 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>>>> If I upgrade to 1.8, then I get the delete queries. Now, If I delete >>>>>>> the nodes, will the node ids for other users remain unchanged or neo4j >>>>>>> automatically reuses the deleted ids?
>>>>>>> On Thursday, 8 November 2012 02:42:51 UTC+5:30, divyanshu das wrote:
>>>>>>>> Hey, thanks for prompt replies. If I am correct, node(*) method is >>>>>>>> not available in 1.6.1. Any workaround for this?
>>>>>>>> On Thursday, 8 November 2012 02:40:29 UTC+5:30, Wes Freeman wrote:
>>>>>>>>> I guess that's not exactly what you asked for... how about this:
>>>>>>>>> start n=node(*) >>>>>>>>> match n-[:rel]->() >>>>>>>>> where has(n.arr) and not(n.prop in n.arr) >>>>>>>>> return n;
>>>>>>>>> On Wed, Nov 7, 2012 at 3:54 PM, Wes Freeman <freem...@gmail.com>wrote:
>>>>>>>>>> You can't delete via Cypher with that version of Neo.
>>>>>>>>>> If you want to just find them, you could do something like (I'm >>>>>>>>>> not entirely sure this worked back then, either--you might consider >>>>>>>>>> upgrading):
>>>>>>>>>> start n=node(*) >>>>>>>>>> where n.prop in n.arr >>>>>>>>>> return n;
>>>>>>>>>> Wes
>>>>>>>>>> On Wed, Nov 7, 2012 at 3:43 PM, divyanshu das < >>>>>>>>>> divyan...@gmail.com> wrote:
>>>>>>>>>>> I have neo4j 1.6.1 and I am using php .
>>>>>>>>>>> I have an array "arr" of a particular property "prop" of nodes.
>>>>>>>>>>> I want to delete all nodes from neo4j having a certain >>>>>>>>>>> relationship "rel" except for the nodes whose property "prop" is in the >>>>>>>>>>> array "arr".
On Friday, 9 November 2012 01:55:24 UTC+5:30, Wes Freeman wrote:
> Your queries might be mixing up the "n" and "b" identifiers. I think you > mean: > "has(b.prop) and not(b.prop in {phparr})"
> Wes
> On Thu, Nov 8, 2012 at 3:19 PM, divyanshu das <divyan...@gmail.com<javascript:> > > wrote:
>> Yes, I do have indexes.
>> this is the query I am using:- $queryTemplate = "START n = node(*) MATCH >> n-[:rel]->b WHERE has(n.prop) AND not(b.prop in {phparr}) RETURN b"; >> phparr is one single array.
>> Ideally this query should return all the list of nodes "b" , which has a >> "rel" relationship and b.prop is not an element of array. >> But it gives the error I pasted earlier
>> If I use this query:- $queryTemplate = "START n = node(1239147) MATCH >> n-[:rel]->b WHERE (n.prop in {phparr}) RETURN b";
>> I get nodes with b.prop in the array.
>> But when I use this query with a "not" in where clause it gives no >> results. I have tried it with 10 nodes. everytime zero results.
>> My db has 6 million nodes, and 1645 have property "prop"
>> On Friday, 9 November 2012 01:21:33 UTC+5:30, Wes Freeman wrote:
>>> It will. David is just saying (in response to the question about how to >>> delete in cypher, earlier in the thread) that if you have indexes on those >>> nodes (do you?), you should query the indexes on the particular fields that >>> are indexed so the indexes get cleaned up, afterward. You also need to >>> delete the relationships connected to those nodes at the same time (else >>> you'll get an error about not being able to delete nodes with >>> relationships), so you might end up with something like "match n-[r?]-() >>> ... delete n,r;"
>>> I'm not sure what the PHP error is coming from--I'm not much of a PHP >>> guy, myself. Is this a single command that's failing after 10 minutes, or >>> are you iterating through some list of arrays and it's failing on one of >>> the particular arrays?
>>> On Thu, Nov 8, 2012 at 1:42 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>> thnx for pointing this out. But I did not quite understand it. Does >>>> this mean, that if I replace "return" by "delete" it wont delete the nodes?
>>>> However, right now, I want to return those nodes first so that I can >>>> check if I am actually deleting the right node.
>>>> On Friday, 9 November 2012 00:03:03 UTC+5:30, David Montag wrote:
>>>>> Just want to jump in here. The current workaround for deleting indexed >>>>> nodes with Cypher requires you to know what indexes the node is indexed in, >>>>> and for which property keys and values it is indexed. You can then delete >>>>> the node, and then look it up in all indexes where it was previously >>>>> indexed. This will not return any results, but it will trigger the >>>>> necessary cleanup of the index.
>>>>> David
>>>>> On Wed, Nov 7, 2012 at 1:36 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>>> Is there any other way to delete nodes in 1.6.1 without using cypher >>>>>> queries?
>>>>>> On Thursday, 8 November 2012 02:56:56 UTC+5:30, Wes Freeman wrote:
>>>>>>> It isn't a good idea to depend on node ids for long term use >>>>>>> (rather, use an email address or guid or similar unique id, with an index). >>>>>>> Ids are reused after you restart the server, I think, if they were deleted.
>>>>>>> Wes
>>>>>>> On Wed, Nov 7, 2012 at 4:18 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>>>>> If I upgrade to 1.8, then I get the delete queries. Now, If I >>>>>>>> delete the nodes, will the node ids for other users remain unchanged or >>>>>>>> neo4j automatically reuses the deleted ids?
>>>>>>>> On Thursday, 8 November 2012 02:42:51 UTC+5:30, divyanshu das wrote:
>>>>>>>>> Hey, thanks for prompt replies. If I am correct, node(*) method is >>>>>>>>> not available in 1.6.1. Any workaround for this?
>>>>>>>>> On Thursday, 8 November 2012 02:40:29 UTC+5:30, Wes Freeman wrote:
>>>>>>>>>> I guess that's not exactly what you asked for... how about this:
>>>>>>>>>> start n=node(*) >>>>>>>>>> match n-[:rel]->() >>>>>>>>>> where has(n.arr) and not(n.prop in n.arr) >>>>>>>>>> return n;
>>>>>>>>>> On Wed, Nov 7, 2012 at 3:54 PM, Wes Freeman <freem...@gmail.com>wrote:
>>>>>>>>>>> You can't delete via Cypher with that version of Neo.
>>>>>>>>>>> If you want to just find them, you could do something like (I'm >>>>>>>>>>> not entirely sure this worked back then, either--you might consider >>>>>>>>>>> upgrading):
>>>>>>>>>>> start n=node(*) >>>>>>>>>>> where n.prop in n.arr >>>>>>>>>>> return n;
>>>>>>>>>>> Wes
>>>>>>>>>>> On Wed, Nov 7, 2012 at 3:43 PM, divyanshu das < >>>>>>>>>>> divyan...@gmail.com> wrote:
>>>>>>>>>>>> I have neo4j 1.6.1 and I am using php .
>>>>>>>>>>>> I have an array "arr" of a particular property "prop" of nodes.
>>>>>>>>>>>> I want to delete all nodes from neo4j having a certain >>>>>>>>>>>> relationship "rel" except for the nodes whose property "prop" is in the >>>>>>>>>>>> array "arr".
On Friday, 9 November 2012 02:12:45 UTC+5:30, divyanshu das wrote:
> the database is designed in a way that, if a node has "rel" relationship > it'll have "prop" property too.
> has(n.prop) is just to check if starting node has "prop" property.
> On Friday, 9 November 2012 01:55:24 UTC+5:30, Wes Freeman wrote:
>> Your queries might be mixing up the "n" and "b" identifiers. I think you >> mean: >> "has(b.prop) and not(b.prop in {phparr})"
>> Wes
>> On Thu, Nov 8, 2012 at 3:19 PM, divyanshu das <divyan...@gmail.com>wrote:
>>> Yes, I do have indexes.
>>> this is the query I am using:- $queryTemplate = "START n = node(*) MATCH >>> n-[:rel]->b WHERE has(n.prop) AND not(b.prop in {phparr}) RETURN b"; >>> phparr is one single array.
>>> Ideally this query should return all the list of nodes "b" , which has a >>> "rel" relationship and b.prop is not an element of array. >>> But it gives the error I pasted earlier
>>> If I use this query:- $queryTemplate = "START n = node(1239147) MATCH >>> n-[:rel]->b WHERE (n.prop in {phparr}) RETURN b";
>>> I get nodes with b.prop in the array.
>>> But when I use this query with a "not" in where clause it gives no >>> results. I have tried it with 10 nodes. everytime zero results.
>>> My db has 6 million nodes, and 1645 have property "prop"
>>> On Friday, 9 November 2012 01:21:33 UTC+5:30, Wes Freeman wrote:
>>>> It will. David is just saying (in response to the question about how to >>>> delete in cypher, earlier in the thread) that if you have indexes on those >>>> nodes (do you?), you should query the indexes on the particular fields that >>>> are indexed so the indexes get cleaned up, afterward. You also need to >>>> delete the relationships connected to those nodes at the same time (else >>>> you'll get an error about not being able to delete nodes with >>>> relationships), so you might end up with something like "match n-[r?]-() >>>> ... delete n,r;"
>>>> I'm not sure what the PHP error is coming from--I'm not much of a PHP >>>> guy, myself. Is this a single command that's failing after 10 minutes, or >>>> are you iterating through some list of arrays and it's failing on one of >>>> the particular arrays?
>>>> On Thu, Nov 8, 2012 at 1:42 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>> thnx for pointing this out. But I did not quite understand it. Does >>>>> this mean, that if I replace "return" by "delete" it wont delete the nodes?
>>>>> However, right now, I want to return those nodes first so that I can >>>>> check if I am actually deleting the right node.
>>>>> On Friday, 9 November 2012 00:03:03 UTC+5:30, David Montag wrote:
>>>>>> Just want to jump in here. The current workaround for deleting >>>>>> indexed nodes with Cypher requires you to know what indexes the node is >>>>>> indexed in, and for which property keys and values it is indexed. You can >>>>>> then delete the node, and then look it up in all indexes where it was >>>>>> previously indexed. This will not return any results, but it will trigger >>>>>> the necessary cleanup of the index.
>>>>>> David
>>>>>> On Wed, Nov 7, 2012 at 1:36 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>>>> Is there any other way to delete nodes in 1.6.1 without using cypher >>>>>>> queries?
>>>>>>> On Thursday, 8 November 2012 02:56:56 UTC+5:30, Wes Freeman wrote:
>>>>>>>> It isn't a good idea to depend on node ids for long term use >>>>>>>> (rather, use an email address or guid or similar unique id, with an index). >>>>>>>> Ids are reused after you restart the server, I think, if they were deleted.
>>>>>>>> Wes
>>>>>>>> On Wed, Nov 7, 2012 at 4:18 PM, divyanshu das <divyan...@gmail.com>wrote:
>>>>>>>>> If I upgrade to 1.8, then I get the delete queries. Now, If I >>>>>>>>> delete the nodes, will the node ids for other users remain unchanged or >>>>>>>>> neo4j automatically reuses the deleted ids?
>>>>>>>>> On Thursday, 8 November 2012 02:42:51 UTC+5:30, divyanshu das >>>>>>>>> wrote:
>>>>>>>>>> Hey, thanks for prompt replies. If I am correct, node(*) method >>>>>>>>>> is not available in 1.6.1. Any workaround for this?
>>>>>>>>>> On Thursday, 8 November 2012 02:40:29 UTC+5:30, Wes Freeman wrote:
>>>>>>>>>>> I guess that's not exactly what you asked for... how about this:
>>>>>>>>>>> start n=node(*) >>>>>>>>>>> match n-[:rel]->() >>>>>>>>>>> where has(n.arr) and not(n.prop in n.arr) >>>>>>>>>>> return n;
>>>>>>>>>>> On Wed, Nov 7, 2012 at 3:54 PM, Wes Freeman <freem...@gmail.com>wrote:
>>>>>>>>>>>> You can't delete via Cypher with that version of Neo.
>>>>>>>>>>>> If you want to just find them, you could do something like (I'm >>>>>>>>>>>> not entirely sure this worked back then, either--you might consider >>>>>>>>>>>> upgrading):
>>>>>>>>>>>> start n=node(*) >>>>>>>>>>>> where n.prop in n.arr >>>>>>>>>>>> return n;
>>>>>>>>>>>> Wes
>>>>>>>>>>>> On Wed, Nov 7, 2012 at 3:43 PM, divyanshu das < >>>>>>>>>>>> divyan...@gmail.com> wrote:
>>>>>>>>>>>>> I have neo4j 1.6.1 and I am using php .
>>>>>>>>>>>>> I have an array "arr" of a particular property "prop" of nodes.
>>>>>>>>>>>>> I want to delete all nodes from neo4j having a certain >>>>>>>>>>>>> relationship "rel" except for the nodes whose property "prop" is in the >>>>>>>>>>>>> array "arr".