First I used db:store to store delta.zip into the database. My first problem was I got an error "invalid entry CRC: expected 0x0 but got..." The raw stored file was slightly larger than the original zip.
Could you possibly give us an example to reproduce this?
What is wrong with this code?
The info view shows…
Result: - Hit(s): 0 Items - Updated: 0 Items - Printed: 0 Bytes - Read Locking: global - Write Locking: none
…so my current assumption is that the higher-order functions are not prepared yet to do updates. I will look at this. For now, the following code should work.
for $entry at $pos in $entries let $content := $contents[$pos] let $target := $basePath || '/' || $entry/text() return db:store($database, $target, $content)
Notice, btw, that try/catch won’t catch anything in your query, because the update itself will be run after query evaluation has been completed (look for Pending Update List in our documentation for more information).