Hi So far I was adding documents and querying using Python API (generally sending commands to BaseX).
Now I need to delete some documents. What is the most effective method?
1. drop db I would have to recreate it very soon. I am a bit concerned by other clients being connected to the same database 2. loop in Python performing delete command one document by one 3. do some sort of xquery in style "for $doc in collection() return (delete base-uri($doc))" Note, that this does not work, but there might be some way like this similar to insert or update mechanism
Any ideas or hints?
Thanks for advice
Jan
Hi Jan,
the second option is the only one which will be successful.
just send: delete "document-name" to the server.
Note: If documents have the same name, all of them will be deleted.
The first option is not working cause dropping of a database is not allowed if other clients have the database opened in their context. The third option is not working cause XQuery Update is not intended to delete whole documents from a database.
Kind regards, Andreas
Am 07.12.10 12:39, schrieb Jan Vlčinský (CAD):
Hi So far I was adding documents and querying using Python API (generally sending commands to BaseX).
Now I need to delete some documents. What is the most effective method?
- drop db I would have to recreate it very soon. I am a bit concerned by other clients being connected to the same database
- loop in Python performing delete command one document by one
- do some sort of xquery in style "for $doc in collection() return (delete base-uri($doc))" Note, that this does not work, but there might be some way like this similar to insert or update mechanism
Any ideas or hints?
Thanks for advice
Jan
*Ing. Jan Vlčinský* CAD programy Slunečnicová 338/3, 734 01 Karviná Ráj, Czech Republic tel: +420-597 602 024; mob: +420-608 979 040 skype: janvlcinsky; GoogleTalk: jan.vlcinsky@gmail.com mailto:jan.vlcinsky@gmail.com http://cz.linkedin.com/in/vlcinsky
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
basex-talk@mailman.uni-konstanz.de