Skip to content

Commit db5daef

Browse files
committed
use getPropertyValueWithDefault
1 parent c39fdfa commit db5daef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

phpcr-shell/querying.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,13 @@ Set the value of ``a.title`` to the value of the property :
196196
197197
.. code-block:: bash
198198
199-
PHPCRSH> UPDATE [nt:unstructured] AS a SET a.title = expr('row.getNode().getPropertyValue("some_property")')
199+
PHPCRSH> UPDATE [nt:unstructured] AS a SET a.title = expr('row.getNode().getPropertyValueWithDefault("some_property", null)')
200200
201201
Increment the value of a property:
202202
203203
.. code-block:: bash
204204
205-
PHPCRSH> UPDATE [nt:unstructured] AS a SET a.count = expr('row.getNode().getPropertyValue("count") + 1')
205+
PHPCRSH> UPDATE [nt:unstructured] AS a SET a.count = expr('row.getNode().getPropertyValueWithDefault("count", 0) + 1')
206206
207207
Set the value of ``a.title`` from the value of a joined node:
208208

0 commit comments

Comments
 (0)