If you can use RESTXQ to create a function, you could use something like:

db:add($todb, db:open($fromdb, $path), $path)

inside a function available that is made available via RESTXQ.


[] On Behalf Of Christian Grün
Sent: Thursday, September 22, 2016 11:19 AM
To: Adil Hasan <>
Cc: BaseX <>
Subject: Re: [basex-talk] using rest api to move a file

Hi Adil,

Thanks for mentioning the null pointer exception, this is clearly
something that should be fixed (if you are interested, you can follow
the issue that I’ve just created [1]).

rename test1.xml test-moved/test1.xml

With this command, you can move documents inside a single database.
There is currently no fixed solution to move resources across
database, so you’ll probably have to use two requests for this (GET
and PUT).

Hope this helps


> </command>
> The command returns a 200, but nothing has moved. I am clearly doing something
> wrong. If I change the URL in the cURL request to "http://localhost:8984/rest";
> I get a java null pointer exception.
> Do you know they syntax I should use for the REST API to move a file?
> many thanks,
> adil

Reply via email to