Getting Started

Tutorial: Building with CleaveDB

Bulk Writes

When a handful of records are ready at the same time, writing them one by one can turn a simple import into a long procession of commands. POUR MANY accepts an array of JSON objects and sends the whole group to one bucket in a single statement. It suits a first load of user profiles, a small catalog import, or another set of documents that belong together.

CleaveQLExample · Add two users together
POUR MANY INTO users [{"name": "A"}, {"name": "B"}]

How to read the batch

POUR MANY starts the bulk write, INTO users chooses the shared destination, and the square brackets contain the documents to write. Each object is a separate document payload; in this example, both user records are sent to users. Add or remove objects in the array to match the size of the group you need to load.

When to reach for POUR MANY

Choose it when the documents share a destination and should pass validation as a group. If one item fails a rule, correct its fields and submit the batch again; you will not be left guessing which earlier items made it into the bucket. For records that belong in different buckets or should be written at different times, use separate POUR commands so each write has its own destination and timing.