I tried with RETURN. It returns Node. Correct node. But no node in database.
Interesting fact. When I trying to find this node using browser *MATCH n 
WHERE ID(n)=11880* (id from return) it finds one node. But node is without 
any property or label and colored lightgrey. But no such node in answer on 
*MATCH 
n RETURN n. *And after restarting Neo4j even looking with ID unsuccessful.

понедельник, 19 мая 2014 г., 19:55:15 UTC+4 пользователь Nigel Small 
написал:
>
> You won't see any return values from your Cypher unless you include a 
> "RETURN n" clause at the end of your statement. This is probably your 
> problem here.
>
> On a side note, I'd strongly advise again that you do not use % 
> substitution and use Cypher parameters instead. You will hit problems with 
> unescaped characters at some point otherwise.
>
> Nige
>
>
> On 19 May 2014 16:45, Александр Богданов <lanakr...@gmail.com<javascript:>
> > wrote:
>
>> *query("CREATE (n:person {name:'%s', nickname:'%s', md5:'%s'})" % (name, 
>> nickname, hashlib.md5(password).hexdigest()))*
>>
>> query() definition:
>>
>> *class CypherQuery:*
>> *    def __init__(self, service):*
>> *        self.session = cypher.Session(service)*
>> *    def cypher_q(self, input, count=1):*
>> *        if count == 1:*
>> *            return [x.values[0] for x in self.session.execute(input)]*
>> *        else:*
>> *            return [x.values for x in self.session.execute(input)]    *
>>         
>> *CQ = CypherQuery('http://localhost:7474 <http://localhost:7474>')*
>> *query = CQ.cypher_q*
>>
>>
>> понедельник, 19 мая 2014 г., 18:26:55 UTC+4 пользователь Nigel Small 
>> написал:
>>>
>>> Could you post a section of Python code that includes a CREATE statement 
>>> that fails for you?
>>>
>>> Incidentally, you would be better off using Cypher parameters (passed in 
>>> the *execute* method) than the Python level % substitution you have 
>>> here. This will improve both performance and reliability with "odd" 
>>> characters. On this subject, do your properties contain ' marks? This could 
>>> be breaking the query.
>>>
>>> Nige
>>>
>>>
>>> On 19 May 2014 15:04, Александр Богданов <lanakr...@gmail.com> wrote:
>>>
>>>> *CREATE (n:person {name:'%s', nickname:'%s', md5:'%s'})*
>>>> %s - strings
>>>>
>>>> воскресенье, 18 мая 2014 г., 15:39:45 UTC+4 пользователь Michael Hunger 
>>>> написал:
>>>>>
>>>>> Can you show your delete and create statements?
>>>>>
>>>>> You should probably also use parameters for your id *WHERE ID(p)={id}*
>>>>>
>>>>>
>>>>> On Sat, May 17, 2014 at 3:31 PM, Александр Богданов <
>>>>> lanakr...@gmail.com> wrote:
>>>>>
>>>>>> Hello.
>>>>>>
>>>>>> Problems with writing to database from python script.
>>>>>>
>>>>>> Opening session:
>>>>>> *self.session = cypher.Session(http://localhost:7474 
>>>>>> <http://localhost:7474>)*
>>>>>>
>>>>>> query like this:
>>>>>> *self.session.execute("MATCH (p:person)-[:has_a_role]-(role) WHERE 
>>>>>> ID(p)=%d RETURN role.role") *
>>>>>> working well. I receiving all information i need.
>>>>>>
>>>>>> but if i trying to create node or delete it doesnt work.
>>>>>> no errors
>>>>>> even correct node in return of execute() function if i trying to 
>>>>>> create it. but no such node in response on query like 
>>>>>> *self.session.execute("MATCH 
>>>>>> (n) RETURN n")*
>>>>>> and in http://127.0.0.1:7474/browser/ no such node too. but if i 
>>>>>> trying in browser - it creates.
>>>>>>
>>>>>> something with configuration? why can't i correctly use write-queries 
>>>>>> with *py2neo.cypher.Session.execute()* ?
>>>>>>
>>>>>> PS: Sorry for my english and thank you.
>>>>>>
>>>>>> -- 
>>>>>> 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+un...@googlegroups.com.
>>>>>>
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>>
>>>>>  -- 
>>>> 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+un...@googlegroups.com.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>  -- 
>> 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+un...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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/d/optout.

Reply via email to