However, when I try to run a query using db:replace: return db:replace($database, $jsonXML, $targetProfilePath)
You'll probably need to swap the second and third argument; see [1]. I agree it's confusing that the signatures for db:add() and db:replace() differ. This is due to backward compatibility issues, and may be fixed with a future db:update() function that will combine the functionality of both db:add() and db:replace().
[1] http://docs.basex.org/wiki/Database_Module#db:replace
I get the following error regardless of whether there is a document in the db at that path or not: [FODC0002] Resource "/targetProfiles/5321cff2e4b0372d556893f4" does not exist.
db:add() seems to be working fine but I would prefer not to add multiple documents at the same path.
I suppose I can work around this by first using db:delete() to remove any documents at the path and then using db:add() but I would appreciate any insight into why db:replace() isn't working as expected.
Thanks, -Jesse
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk