deleting nodes/elements permanently from BaseX
Hello Irfan,
The nodes are actually deleted and the operation is commited. The update invalidates the meta data (e.g. the size), so to reflect the changes you can run the OPTIMIZE command. See https://docs.basex.org/wiki/Commands#OPTIMIZE for some more information.
Cheers, Dirk
Quoted text · Irfan Khan · 75 lines
On 06/02/14 13:35, Irfan Khan wrote: > Hello, > > I am new to BaseX and am doing basic manipulations, but can't delete nodes/elements permanently from a Database. > > So these are my databases: > >> list > name Resources Size Input Path > ---------------------------------------------- > Example 1 34928 > Experiment_Owner 3 4651 > Store 3 14015 > TestbyIrfan 0 4541 > Users 299 86299 > Workon 1 4753 > > 6 database(s) > > > > open Users > > XQUERY / > > > <user> > <fullname>null</fullname> > <username>user590</username> > <password>3b36431be670500f759191b1cc27adc3</password> > <experiments/> > <email>email</email> > <role>ROLE_BEE</role> > </user><user> > <fullname>null</fullname> > <username>user591</username> > <password>18b944141c4104d3a577516e7aa429</password> > <experiments/> > <email>email</email> > <role>ROLE_BEE</role> > </user> > > > > afterwards to delete the users I tried commands such as: > > XQUERY delete node db:open("Users")//user or > > XQUERY for $v in /user where $v[contains(username,"user")] return delete node $v/user > > > > then the records disappear, the command XQUERY / doesn't show the records of users, however when I do a command list, > > the size of the database and the number of resources don't change. > > I tried to do an Export like: EXPORT /root/BEES_CENTRAL/BaseXData/data but no change.... > > So my question is how can I commit the changes made by Delete to disk permanently ? > > > Thanks a lot. > > > Regards, > > Irfan > > > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
Hello,
I am new to BaseX and am doing basic manipulations, but can't delete nodes/elements permanently from a Database.
So these are my databases:
Quoted text · 1 line
> list
name Resources Size Input Path ---------------------------------------------- Example 1 34928 Experiment_Owner 3 4651 Store 3 14015 TestbyIrfan 0 4541 Users 299 86299 Workon 1 4753
6 database(s)
open Users
XQUERY /
<user>
<fullname>null</fullname>
<username>user590</username>
<password>3b36431be670500f759191b1cc27adc3</password>
<experiments/>
<email>email</email>
<role>ROLE_BEE</role>
</user><user>
<fullname>null</fullname>
<username>user591</username>
<password>18b944141c4104d3a577516e7aa429</password>
<experiments/>
<email>email</email>
<role>ROLE_BEE</role>
</user>afterwards to delete the users I tried commands such as:
XQUERY delete node db:open("Users")//user or
XQUERY for $v in /user where $v[contains(username,"user")] return delete node $v/user
then the records disappear, the command XQUERY / doesn't show the records of users, however when I do a command list,
the size of the database and the number of resources don't change.
I tried to do an Export like: EXPORT /root/BEES_CENTRAL/BaseXData/data but no change....
So my question is how can I commit the changes made by Delete to disk permanently ?
Thanks a lot.
Regards,
Irfan
Written for BaseX 7.7. BaseX may have changed since: please check the current documentation.