Unable to delete files

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Unable to delete files

John Preimonas-2
Hi,
I want to delete 8000+ files from the eXist database, but it does not work.
I cannot even find the files using webbed, so that I can remove them manually.
I also cannot find them in org.exist subdirectories, to once again rm them.

The following fails to work:

xquery version "3.0";
let $login :=     xmldb:login('/db/apps/sandpit/data/identities', 'my-login', 'my-password')
for $hits in collection('/db/apps/sandpit/data/identities')/person[xs:integer(id) > 11024]
    let $document := util:document-name($hits)
return
     file:delete(‘/db/apps/sandpit/data/identities/' || $document)

results come up as ‘false’, and, of course, the files are not deleted.

What am I missing?

Regards,
John




------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Unable to delete files

Alister Pillow-3
Hi John,

Could you please tell us which version of eXist you’re using? I guess it’s eXist 2.x.

Your query is trying to use the file module  - which operates on your computer’s filesystem - not the /db - so that won’t do what you want.

please change your query to use:
xmldb:remove('/db/apps/sandpit/data/identities', $document)

… instead of the file:delete function

(assuming the resources are all in the same collection)

While eXist-db stores some resources in the file-system, you should never access them directly.

Regards,
Alister.


> On 15 May 2015, at 7:43 pm, John Preimonas <[hidden email]> wrote:
>
> Hi,
> I want to delete 8000+ files from the eXist database, but it does not work.
> I cannot even find the files using webbed, so that I can remove them manually.
> I also cannot find them in org.exist subdirectories, to once again rm them.
>
> The following fails to work:
>
> xquery version "3.0";
> let $login :=     xmldb:login('/db/apps/sandpit/data/identities', 'my-login', 'my-password')
> for $hits in collection('/db/apps/sandpit/data/identities')/person[xs:integer(id) > 11024]
>    let $document := util:document-name($hits)
> return
>     file:delete(‘/db/apps/sandpit/data/identities/' || $document)
>
> results come up as ‘false’, and, of course, the files are not deleted.
>
> What am I missing?
>
> Regards,
> John
>
>
>
>
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> Exist-open mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/exist-open


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Unable to delete files

John Preimonas-2
Hi Alister,
Yes, it's 2.2.
And no that didn't work either. I got "ERROR Could not locate collection: /db/apps/sandpit/data/identities11135.xml [at line 6, column 6]"
Yet when I looked into the collection it and the <11135 files were still there, plus the others I wish to delete.
John


Sent from my iPad

> On 15 May 2015, at 8:45 pm, Alister Pillow <[hidden email]> wrote:
>
> Hi John,
>
> Could you please tell us which version of eXist you’re using? I guess it’s eXist 2.x.
>
> Your query is trying to use the file module  - which operates on your computer’s filesystem - not the /db - so that won’t do what you want.
>
> please change your query to use:
> xmldb:remove('/db/apps/sandpit/data/identities', $document)
>
> … instead of the file:delete function
>
> (assuming the resources are all in the same collection)
>
> While eXist-db stores some resources in the file-system, you should never access them directly.
>
> Regards,
> Alister.
>
>
>> On 15 May 2015, at 7:43 pm, John Preimonas <[hidden email]> wrote:
>>
>> Hi,
>> I want to delete 8000+ files from the eXist database, but it does not work.
>> I cannot even find the files using webbed, so that I can remove them manually.
>> I also cannot find them in org.exist subdirectories, to once again rm them.
>>
>> The following fails to work:
>>
>> xquery version "3.0";
>> let $login :=     xmldb:login('/db/apps/sandpit/data/identities', 'my-login', 'my-password')
>> for $hits in collection('/db/apps/sandpit/data/identities')/person[xs:integer(id) > 11024]
>>   let $document := util:document-name($hits)
>> return
>>    file:delete(‘/db/apps/sandpit/data/identities/' || $document)
>>
>> results come up as ‘false’, and, of course, the files are not deleted.
>>
>> What am I missing?
>>
>> Regards,
>> John
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> One dashboard for servers and applications across Physical-Virtual-Cloud
>> Widest out-of-the-box monitoring support with 50+ applications
>> Performance metrics, stats and reports that give you Actionable Insights
>> Deep dive visibility with transaction tracing using APM Insight.
>> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
>> _______________________________________________
>> Exist-open mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/exist-open
>
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Unable to delete files

Joe Wicentowski
Are you sure you used Alister's code, with a *comma* separating the two parameters:

  xmldb:remove('/db/apps/sandpit/data/identities', $document)

Rather than the concatenation operator || that you first used:

  xmldb:remove('/db/apps/sandpit/data/identities' || $document)

The error looks to me like the latter.

Sent from my iPad

> On May 15, 2015, at 8:05 AM, John Preimonas <[hidden email]> wrote:
>
> Hi Alister,
> Yes, it's 2.2.
> And no that didn't work either. I got "ERROR Could not locate collection: /db/apps/sandpit/data/identities11135.xml [at line 6, column 6]"
> Yet when I looked into the collection it and the <11135 files were still there, plus the others I wish to delete.
> John
>
>
> Sent from my iPad
>
>> On 15 May 2015, at 8:45 pm, Alister Pillow <[hidden email]> wrote:
>>
>> Hi John,
>>
>> Could you please tell us which version of eXist you’re using? I guess it’s eXist 2.x.
>>
>> Your query is trying to use the file module  - which operates on your computer’s filesystem - not the /db - so that won’t do what you want.
>>
>> please change your query to use:
>> xmldb:remove('/db/apps/sandpit/data/identities', $document)
>>
>> … instead of the file:delete function
>>
>> (assuming the resources are all in the same collection)
>>
>> While eXist-db stores some resources in the file-system, you should never access them directly.
>>
>> Regards,
>> Alister.
>>
>>
>>> On 15 May 2015, at 7:43 pm, John Preimonas <[hidden email]> wrote:
>>>
>>> Hi,
>>> I want to delete 8000+ files from the eXist database, but it does not work.
>>> I cannot even find the files using webbed, so that I can remove them manually.
>>> I also cannot find them in org.exist subdirectories, to once again rm them.
>>>
>>> The following fails to work:
>>>
>>> xquery version "3.0";
>>> let $login :=     xmldb:login('/db/apps/sandpit/data/identities', 'my-login', 'my-password')
>>> for $hits in collection('/db/apps/sandpit/data/identities')/person[xs:integer(id) > 11024]
>>>  let $document := util:document-name($hits)
>>> return
>>>   file:delete(‘/db/apps/sandpit/data/identities/' || $document)
>>>
>>> results come up as ‘false’, and, of course, the files are not deleted.
>>>
>>> What am I missing?
>>>
>>> Regards,
>>> John
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> One dashboard for servers and applications across Physical-Virtual-Cloud
>>> Widest out-of-the-box monitoring support with 50+ applications
>>> Performance metrics, stats and reports that give you Actionable Insights
>>> Deep dive visibility with transaction tracing using APM Insight.
>>> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
>>> _______________________________________________
>>> Exist-open mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/exist-open
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> Exist-open mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/exist-open

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Unable to delete files

Michael Westbay-2
In reply to this post by John Preimonas-2
Preimonas-san,


The following fails to work:

xquery version "3.0";
let $login :=     xmldb:login('/db/apps/sandpit/data/identities', 'my-login', 'my-password')
for $hits in collection('/db/apps/sandpit/data/identities')/person[xs:integer(id) > 11024]
    let $document := util:document-name($hits)
return
     file:delete(‘/db/apps/sandpit/data/identities/' || $document)

Try this:

xquery version "3.0";
let $login :=     xmldb:login('/db/apps/sandpit/data/identities', 'my-login', 'my-password')
for $hits in collection('/db/apps/sandpit/data/identities')/person[xs:integer(id) > 11024]
  let $file := util:document-name($hits)
  let $col := util:collection-name($hits)
  return <remove id="{$hits/@id}">{$col}/{$file}{xmldb:remove($col, $file)}</remove>

===

Note that this returns multiple XML fragments. Browsers don't like that. But eXide can handle it.


--
Michael Westbay
Writer/System Administrator
http://www.japanesebaseball.com/

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Unable to delete files

Alister Pillow-3
In reply to this post by John Preimonas-2

I like to test these queries (particularly when it involves deleting) by emitting text first. This will just output text...

Please try this:
for $hit in collection('/db/apps/sandpit/data/identities')/person[xs:integer(id) > 11024]
let $col := util:collection-name($hit)
let $document := util:document-name($hit)
return "xmldb:delete('" ||  $col || "', '" || $document || "')"


if that works and appears correct, copy any one of the output lines into eXide and run it - it should delete the resource.
Finally, replace the last line with the real delete function
xmldb:delete($col, $document)




> On 15 May 2015, at 9:35 pm, John Preimonas <[hidden email]> wrote:
>
> Hi Alister,
> Yes, it's 2.2.
> And no that didn't work either. I got "ERROR Could not locate collection: /db/apps/sandpit/data/identities11135.xml [at line 6, column 6]"
> Yet when I looked into the collection it and the <11135 files were still there, plus the others I wish to delete.
> John
>
>
> Sent from my iPad
>
>> On 15 May 2015, at 8:45 pm, Alister Pillow <[hidden email]> wrote:
>>
>> Hi John,
>>
>> Could you please tell us which version of eXist you’re using? I guess it’s eXist 2.x.
>>
>> Your query is trying to use the file module  - which operates on your computer’s filesystem - not the /db - so that won’t do what you want.
>>
>> please change your query to use:
>> xmldb:remove('/db/apps/sandpit/data/identities', $document)
>>
>> … instead of the file:delete function
>>
>> (assuming the resources are all in the same collection)
>>
>> While eXist-db stores some resources in the file-system, you should never access them directly.
>>
>> Regards,
>> Alister.
>>
>>
>>> On 15 May 2015, at 7:43 pm, John Preimonas <[hidden email]> wrote:
>>>
>>> Hi,
>>> I want to delete 8000+ files from the eXist database, but it does not work.
>>> I cannot even find the files using webbed, so that I can remove them manually.
>>> I also cannot find them in org.exist subdirectories, to once again rm them.
>>>
>>> The following fails to work:
>>>
>>> xquery version "3.0";
>>> let $login :=     xmldb:login('/db/apps/sandpit/data/identities', 'my-login', 'my-password')
>>> for $hits in collection('/db/apps/sandpit/data/identities')/person[xs:integer(id) > 11024]
>>>  let $document := util:document-name($hits)
>>> return
>>>   file:delete(‘/db/apps/sandpit/data/identities/' || $document)
>>>
>>> results come up as ‘false’, and, of course, the files are not deleted.
>>>
>>> What am I missing?
>>>
>>> Regards,
>>> John
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> One dashboard for servers and applications across Physical-Virtual-Cloud
>>> Widest out-of-the-box monitoring support with 50+ applications
>>> Performance metrics, stats and reports that give you Actionable Insights
>>> Deep dive visibility with transaction tracing using APM Insight.
>>> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
>>> _______________________________________________
>>> Exist-open mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/exist-open
>>


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Unable to delete files

Joe Wicentowski
Surely you mean xmldb:remove()?

Sent from my iPhone

> On May 15, 2015, at 8:53 AM, Alister Pillow <[hidden email]> wrote:
>
>
> I like to test these queries (particularly when it involves deleting) by emitting text first. This will just output text...
>
> Please try this:
> for $hit in collection('/db/apps/sandpit/data/identities')/person[xs:integer(id) > 11024]
> let $col := util:collection-name($hit)
> let $document := util:document-name($hit)
> return "xmldb:delete('" ||  $col || "', '" || $document || "')"
>
>
> if that works and appears correct, copy any one of the output lines into eXide and run it - it should delete the resource.
> Finally, replace the last line with the real delete function
> xmldb:delete($col, $document)
>
>
>
>
>> On 15 May 2015, at 9:35 pm, John Preimonas <[hidden email]> wrote:
>>
>> Hi Alister,
>> Yes, it's 2.2.
>> And no that didn't work either. I got "ERROR Could not locate collection: /db/apps/sandpit/data/identities11135.xml [at line 6, column 6]"
>> Yet when I looked into the collection it and the <11135 files were still there, plus the others I wish to delete.
>> John
>>
>>
>> Sent from my iPad
>>
>>> On 15 May 2015, at 8:45 pm, Alister Pillow <[hidden email]> wrote:
>>>
>>> Hi John,
>>>
>>> Could you please tell us which version of eXist you’re using? I guess it’s eXist 2.x.
>>>
>>> Your query is trying to use the file module  - which operates on your computer’s filesystem - not the /db - so that won’t do what you want.
>>>
>>> please change your query to use:
>>> xmldb:remove('/db/apps/sandpit/data/identities', $document)
>>>
>>> … instead of the file:delete function
>>>
>>> (assuming the resources are all in the same collection)
>>>
>>> While eXist-db stores some resources in the file-system, you should never access them directly.
>>>
>>> Regards,
>>> Alister.
>>>
>>>
>>>> On 15 May 2015, at 7:43 pm, John Preimonas <[hidden email]> wrote:
>>>>
>>>> Hi,
>>>> I want to delete 8000+ files from the eXist database, but it does not work.
>>>> I cannot even find the files using webbed, so that I can remove them manually.
>>>> I also cannot find them in org.exist subdirectories, to once again rm them.
>>>>
>>>> The following fails to work:
>>>>
>>>> xquery version "3.0";
>>>> let $login :=     xmldb:login('/db/apps/sandpit/data/identities', 'my-login', 'my-password')
>>>> for $hits in collection('/db/apps/sandpit/data/identities')/person[xs:integer(id) > 11024]
>>>> let $document := util:document-name($hits)
>>>> return
>>>>  file:delete(‘/db/apps/sandpit/data/identities/' || $document)
>>>>
>>>> results come up as ‘false’, and, of course, the files are not deleted.
>>>>
>>>> What am I missing?
>>>>
>>>> Regards,
>>>> John
>>>>
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> One dashboard for servers and applications across Physical-Virtual-Cloud
>>>> Widest out-of-the-box monitoring support with 50+ applications
>>>> Performance metrics, stats and reports that give you Actionable Insights
>>>> Deep dive visibility with transaction tracing using APM Insight.
>>>> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
>>>> _______________________________________________
>>>> Exist-open mailing list
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/exist-open
>
>
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> Exist-open mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/exist-open

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Unable to delete files

Alister Pillow-3
Of course. Thanks Joe. Apologies for any confusion.

Sent from my iPad

> On 15 May 2015, at 10:56 pm, Joe Wicentowski <[hidden email]> wrote:
>
> Surely you mean xmldb:remove()?
>
> Sent from my iPhone
>
>> On May 15, 2015, at 8:53 AM, Alister Pillow <[hidden email]> wrote:
>>
>>
>> I like to test these queries (particularly when it involves deleting) by emitting text first. This will just output text...
>>
>> Please try this:
>> for $hit in collection('/db/apps/sandpit/data/identities')/person[xs:integer(id) > 11024]
>> let $col := util:collection-name($hit)
>> let $document := util:document-name($hit)
>> return "xmldb:delete('" ||  $col || "', '" || $document || "')"
>>
>>
>> if that works and appears correct, copy any one of the output lines into eXide and run it - it should delete the resource.
>> Finally, replace the last line with the real delete function
>> xmldb:delete($col, $document)
>>
>>
>>
>>
>>> On 15 May 2015, at 9:35 pm, John Preimonas <[hidden email]> wrote:
>>>
>>> Hi Alister,
>>> Yes, it's 2.2.
>>> And no that didn't work either. I got "ERROR Could not locate collection: /db/apps/sandpit/data/identities11135.xml [at line 6, column 6]"
>>> Yet when I looked into the collection it and the <11135 files were still there, plus the others I wish to delete.
>>> John
>>>
>>>
>>> Sent from my iPad
>>>
>>>> On 15 May 2015, at 8:45 pm, Alister Pillow <[hidden email]> wrote:
>>>>
>>>> Hi John,
>>>>
>>>> Could you please tell us which version of eXist you’re using? I guess it’s eXist 2.x.
>>>>
>>>> Your query is trying to use the file module  - which operates on your computer’s filesystem - not the /db - so that won’t do what you want.
>>>>
>>>> please change your query to use:
>>>> xmldb:remove('/db/apps/sandpit/data/identities', $document)
>>>>
>>>> … instead of the file:delete function
>>>>
>>>> (assuming the resources are all in the same collection)
>>>>
>>>> While eXist-db stores some resources in the file-system, you should never access them directly.
>>>>
>>>> Regards,
>>>> Alister.
>>>>
>>>>
>>>>> On 15 May 2015, at 7:43 pm, John Preimonas <[hidden email]> wrote:
>>>>>
>>>>> Hi,
>>>>> I want to delete 8000+ files from the eXist database, but it does not work.
>>>>> I cannot even find the files using webbed, so that I can remove them manually.
>>>>> I also cannot find them in org.exist subdirectories, to once again rm them.
>>>>>
>>>>> The following fails to work:
>>>>>
>>>>> xquery version "3.0";
>>>>> let $login :=     xmldb:login('/db/apps/sandpit/data/identities', 'my-login', 'my-password')
>>>>> for $hits in collection('/db/apps/sandpit/data/identities')/person[xs:integer(id) > 11024]
>>>>> let $document := util:document-name($hits)
>>>>> return
>>>>> file:delete(‘/db/apps/sandpit/data/identities/' || $document)
>>>>>
>>>>> results come up as ‘false’, and, of course, the files are not deleted.
>>>>>
>>>>> What am I missing?
>>>>>
>>>>> Regards,
>>>>> John
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> One dashboard for servers and applications across Physical-Virtual-Cloud
>>>>> Widest out-of-the-box monitoring support with 50+ applications
>>>>> Performance metrics, stats and reports that give you Actionable Insights
>>>>> Deep dive visibility with transaction tracing using APM Insight.
>>>>> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
>>>>> _______________________________________________
>>>>> Exist-open mailing list
>>>>> [hidden email]
>>>>> https://lists.sourceforge.net/lists/listinfo/exist-open
>>
>>
>> ------------------------------------------------------------------------------
>> One dashboard for servers and applications across Physical-Virtual-Cloud
>> Widest out-of-the-box monitoring support with 50+ applications
>> Performance metrics, stats and reports that give you Actionable Insights
>> Deep dive visibility with transaction tracing using APM Insight.
>> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
>> _______________________________________________
>> Exist-open mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/exist-open

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Unable to delete files

John Preimonas-2
In reply to this post by John Preimonas-2
Thanks Joe,
Well spotted. I did have || instead of a comma to separate the 2 parameters. The xmldb:remove worked.
Thanks everyone for your quick responses.
Regards,
John
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Unable to delete files

Joe Wicentowski
In reply to this post by Alister Pillow-3
Great suggestion to output a "preview" of the write operation before running it, Alister!

Joe

Sent from my iPad

> On May 15, 2015, at 10:36 AM, Alister Pillow <[hidden email]> wrote:
>
> Of course. Thanks Joe. Apologies for any confusion.
>
> Sent from my iPad
>
>> On 15 May 2015, at 10:56 pm, Joe Wicentowski <[hidden email]> wrote:
>>
>> Surely you mean xmldb:remove()?
>>
>> Sent from my iPhone
>>
>>> On May 15, 2015, at 8:53 AM, Alister Pillow <[hidden email]> wrote:
>>>
>>>
>>> I like to test these queries (particularly when it involves deleting) by emitting text first. This will just output text...
>>>
>>> Please try this:
>>> for $hit in collection('/db/apps/sandpit/data/identities')/person[xs:integer(id) > 11024]
>>> let $col := util:collection-name($hit)
>>> let $document := util:document-name($hit)
>>> return "xmldb:delete('" ||  $col || "', '" || $document || "')"
>>>
>>>
>>> if that works and appears correct, copy any one of the output lines into eXide and run it - it should delete the resource.
>>> Finally, replace the last line with the real delete function
>>> xmldb:delete($col, $document)
>>>
>>>
>>>
>>>
>>>> On 15 May 2015, at 9:35 pm, John Preimonas <[hidden email]> wrote:
>>>>
>>>> Hi Alister,
>>>> Yes, it's 2.2.
>>>> And no that didn't work either. I got "ERROR Could not locate collection: /db/apps/sandpit/data/identities11135.xml [at line 6, column 6]"
>>>> Yet when I looked into the collection it and the <11135 files were still there, plus the others I wish to delete.
>>>> John
>>>>
>>>>
>>>> Sent from my iPad
>>>>
>>>>> On 15 May 2015, at 8:45 pm, Alister Pillow <[hidden email]> wrote:
>>>>>
>>>>> Hi John,
>>>>>
>>>>> Could you please tell us which version of eXist you’re using? I guess it’s eXist 2.x.
>>>>>
>>>>> Your query is trying to use the file module  - which operates on your computer’s filesystem - not the /db - so that won’t do what you want.
>>>>>
>>>>> please change your query to use:
>>>>> xmldb:remove('/db/apps/sandpit/data/identities', $document)
>>>>>
>>>>> … instead of the file:delete function
>>>>>
>>>>> (assuming the resources are all in the same collection)
>>>>>
>>>>> While eXist-db stores some resources in the file-system, you should never access them directly.
>>>>>
>>>>> Regards,
>>>>> Alister.
>>>>>
>>>>>
>>>>>> On 15 May 2015, at 7:43 pm, John Preimonas <[hidden email]> wrote:
>>>>>>
>>>>>> Hi,
>>>>>> I want to delete 8000+ files from the eXist database, but it does not work.
>>>>>> I cannot even find the files using webbed, so that I can remove them manually.
>>>>>> I also cannot find them in org.exist subdirectories, to once again rm them.
>>>>>>
>>>>>> The following fails to work:
>>>>>>
>>>>>> xquery version "3.0";
>>>>>> let $login :=     xmldb:login('/db/apps/sandpit/data/identities', 'my-login', 'my-password')
>>>>>> for $hits in collection('/db/apps/sandpit/data/identities')/person[xs:integer(id) > 11024]
>>>>>> let $document := util:document-name($hits)
>>>>>> return
>>>>>> file:delete(‘/db/apps/sandpit/data/identities/' || $document)
>>>>>>
>>>>>> results come up as ‘false’, and, of course, the files are not deleted.
>>>>>>
>>>>>> What am I missing?
>>>>>>
>>>>>> Regards,
>>>>>> John
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> One dashboard for servers and applications across Physical-Virtual-Cloud
>>>>>> Widest out-of-the-box monitoring support with 50+ applications
>>>>>> Performance metrics, stats and reports that give you Actionable Insights
>>>>>> Deep dive visibility with transaction tracing using APM Insight.
>>>>>> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
>>>>>> _______________________________________________
>>>>>> Exist-open mailing list
>>>>>> [hidden email]
>>>>>> https://lists.sourceforge.net/lists/listinfo/exist-open
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> One dashboard for servers and applications across Physical-Virtual-Cloud
>>> Widest out-of-the-box monitoring support with 50+ applications
>>> Performance metrics, stats and reports that give you Actionable Insights
>>> Deep dive visibility with transaction tracing using APM Insight.
>>> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
>>> _______________________________________________
>>> Exist-open mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/exist-open

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open