Closed
Description
When performing an UPDATE query:
UPDATE [nt:unstructured] SET phpcr:classparents = 'Foo' where phpcr:classparents = 'Bar'
The multivalue field phpcr:classparents
will be replaced with a scalar "Bar", regardless of any existing keys and there is no way of specifying multiple values or indexes.
We need to decide upon a syntax for specifying both multiple values and indexes:
Setting a multivalue:
UPDATE [nt:unstructured] SET multivalue = ['Foo', 'Bar', Baz'];
Update a property value by index or value:
# update index 0 of multivalue
UPDATE [nt:unstructured] SET multivalue[0] = 'Foo';
# update the only the member with the value "bar"
UPDATE [nt:unstructured] SET multivalue = 'foo' where multivalue='bar';
Delete a property value by index or value
UPDATE [nt:unstructured] SET multivalue[0] = NULL;
UPDATE [nt:unstructured] SET multivalue = NULL WHERE multivalue="bar";
Note: NULL ewill currently resolve to a string.. this is a bug
Add multivalue property
UPDATE [nt:unstructured] SET multivalue[] = 'bar';