Hi Peter,

I did use API described by that chapter, however I still have problems. My 
nodes have some properties name and type. Now I want to add new properties to 
my nodes.

1. Set property: the section 16.5.1 describes that the 
url http://localhost:7474/db/data/node/5/properties/foo and the body to be put 
is "bar". I assume "foo" is the property name and bar the property value. But 
how is the string "bar" sent in the PUT request while the service accepts a 
JSON object (Content-type = application/json)?
I have tried to put a string or a json object like {"value":"testing"}. I got 
Bad request error as I anticipated. 

2. Update properties: I have tried as 16.5.2 instructs and the result are:
a. If I PUT a JSON object that has all existing properties with new values then 
all properties of the node are updated with new values.
b. If I PUT a JSON object that has only one property with a new value then all 
properties of the node are gone except the property in the PUT with the new 
value.

Would you please explain how I can update a property and how I add new 
properties to a node but existing properties are still intact. Thank you very 
much!

Cheers,


________________________________
From: Peter Neubauer <peter.neuba...@neotechnology.com>
To: Neo4j user discussions <user@lists.neo4j.org>
Sent: Friday, October 14, 2011 11:40 PM
Subject: Re: [Neo4j] Set property on node in Neo4j REST server

Andrew,
You can either update just one property or set and override all of them, see
http://docs.neo4j.org/chunked/snapshot/rest-api-node-properties.html

Does that help?

/peter



On Friday, October 14, 2011, andrew ton <andrewt...@yahoo.com> wrote:
>
>
> Hello,
>
> According to the Neo4j REST API to set a property on a node I send a PUT
request to the node's property URL e.g.
http://localhost:7474/db/data/node/5/properties/{propertyname}.
> This api accepts a JSON object. How do I send a json object that has
property name and value? The sample in the document shows the body of PUT is
just a string while the property name is in the URL.
>
> Is it correct that the API should be
http://localhost:7474/db/data/node/5/properties and the body has an
JSONObject  e.g. {"propertyName":"propertyValue"} ?
> If so then what is the difference between setting property and updating
property ?
>
> Thanks,
> _______________________________________________
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>

-- 

Cheers,

/peter neubauer

GTalk:      neubauer.peter
Skype       peter.neubauer
Phone       +46 704 106975
LinkedIn   http://www.linkedin.com/in/neubauer
Twitter      http://twitter.com/peterneubauer

http://www.neo4j.org               - Your high performance graph database.
http://startupbootcamp.org/    - Öresund - Innovation happens HERE.
http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to