On Thu, Dec 11, 2025 at 12:01:47PM +0000, Meelis Lilbok wrote:
> How to get total count of uploaded files and exclude thumbnails/license files, using sql query?
I think this should work:
SELECT COUNT(*)
FROM bundle b
JOIN bundle2bitstream AS b2b ON b2b.bundle_id = b.uuid
JOIN metadatavalue m ON b.uuid = m.dspace_object_id
JOIN metadatafieldregistry f USING (metadata_field_id)
WHERE f.element = 'title'
AND f.qualifier IS NULL
AND m.text_value = 'ORIGINAL';
The uploaded files should all be in the ORIGINAL bundle, while the
license text is in LICENSE and the thumbnails in THUMBNAIL. The name
of the bundle is in its 'title' metadata field.
--
Mark H. Wood
Lead Technology Analyst
University Library
Indiana University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
library.indianapolis.iu.edu