Skip to content

UPDATE query on multivalue field is scalar. #81

Closed
@dantleech

Description

@dantleech

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';

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions