Hello,
As a workaround, I'm storing the date in the path itself (4th token). I need to delete some paths based on a condition, however, nothing gets deleted.
for $doc in collection('project1')
return document-uri($doc)
---------------------------------------------
project1/RESULT/SOURCEID2/1000/filename1
project1/RESULT/SOURCEID2/2000/filename1
project1/RESULT/SOURCEID3/3000/filename1
project1/RESULT/SOURCEID3/4000/filename2
project1/RESULT/SOURCEID3/5000/filename3
project1/RESULT/SOURCEID1/1000/filename1
---------------------------------------------
for $doc in collection('project1')
let $arr := tokenize(document-uri($doc), '/')
where xs:integer($arr[4]) <= 4000
return
delete node $doc
(: db:delete('project1', document-uri($doc)) :)
--------------------------------------------
I tried both "delete node" and "db:delete" but none seem to delete the paths.
Can someone give me some pointer about what I might be doing wrong?
Thanks,
Anupam
From: Christian Grün <christian.gruen@gmail.com>
To: Anupam Bakshi <bakshia@yahoo.com>
Cc: BaseX <basex-talk@mailman.uni-konstanz.de>
Sent: Sunday, June 3, 2012 8:48 AM
Subject: Re: [basex-talk] Apparant discrepancy in collection and db:list
Hi Anupam,
> It seems that db:list-details() shows the same "modified-date" attribute
> for all resources in a database which is same as the last-modified time of
> any of the paths.
this is because the modification time is currently not stored for each
single resource. It may change in a future version (this could be
aligned with the constraint that a document with a specific path can
only be stored once).
Christian