jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Guggisberg <stefan.guggisb...@gmail.com>
Subject Re: JSOP diff question
Date Fri, 28 Sep 2012 10:43:39 GMT


On 28.09.2012, at 11:05, Mete Atamel <matamel@adobe.com> wrote:

> Hi, 
> 
> I have a question with JSOP diff syntax. Say I want to add a node "a" with
> a property and value. This is the diff I use in the commit:
> 
> diff.append("+\"a\" : {\"prop\" : \"value\"}");
> 
> Is it legal to add "a" and then add its properties in 2 separate add
> operations but in the same commit like this?
> 
> diff.append("+\"a\" : {}");
>        diff.append("+\"a\" : {\"prop\" : \"value\"}");
> 
> Maybe it's not legal because it would try to add node "a" twice?
> 

correct, it should fail. 

> Also, is it legal to do the previous operation but with property in the
> path like this?
> 
> 
>        diff.append("+\"a\" : {}");
>        diff.append("+\"a/prop\" : \"value\"");
> 

this should work.

cheers
stefan

> Thanks,
> Mete
> 

Mime
View raw message