On 28.09.2012, at 11:05, Mete Atamel <[email protected]> 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
>