Dear Michael,
the CREATE is needed not by the db:add() function but by the doc() function.
As the doc() function can be used to retrieve very large external resources, which can eventually trigger out-of-memory errors and other surprises, the function was limited to users with create permissions. This is the reason why data to be stored needs to be added via an input stream or bound to an external variable.
Hope this helps, Christian
It's not important for my current needs (I can run the query under a userid with CREATE permissions), but in the interests of knowledge I wonder: Is there a way to load a document from the Web that does not require CREATE permission?
(And before anyone asks: yes, I could PUT the new document, if I could figure out how to do that from PHP, and if performing the necessary sanity checks were as easy in PHP as it is in XQuery. But neither of those is true at the moment; the first may change, but the second is not ever going to change: given the choice, I'd rather do any work possible in XQuery rather than PHP.)
Thanks!
Michael Sperberg-McQueen
--
- C. M. Sperberg-McQueen, Black Mesa Technologies LLC
- http://www.blackmesatech.com
- http://cmsmcq.com/mib
- http://balisage.net