Getting Started
Tutorial: Building with CleaveDB
Writing to Nested Fields
A profile is rarely complete on the day it is created. A user may add a nickname later; an employee may gain a skill; a product may receive new specifications. The INSIDE … AT form of POUR writes JSON at a field path on an existing document, so you can update one nested part without resending the document’s full contents.
CleaveQLExample · Set profile details
POUR '{"nick": "JJ"}' INSIDE users "jane" AT profileFollow the target and the path
- The quoted JSON:
'{"nick": "JJ"}'is the value you want to write. In this POUR form, pass the JSON as a quoted string. INSIDE users "jane": identify the existing document by its bucket and ID.AT profile: choose the field path to receive that value. Use a dotted path to point deeper into an object, such asprofile.skills.
In this example, the payload is written at Jane’s profile path. To target a deeper field, keep the document address the same and change the path after AT:
CleaveQLExample · Write into a nested path
POUR '{"tool": "CleaveDB"}' INSIDE users "alice" AT profile.skills