From a44f7a1060e32ab54e3d968194d32fc93ab7ad8f Mon Sep 17 00:00:00 2001 From: Dan Jacka Date: Wed, 5 Feb 2025 15:06:50 +1300 Subject: [PATCH] Fix broken "how many batches per entity?" query batch-entity function was returning "releases" for input "releases-artists-1", when it should have been returning "releases-artists". Change the regex so that only the final hyphen and subsequent characters are removed. --- examples/explore_db.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/explore_db.clj b/examples/explore_db.clj index 20b69c1..b20154d 100644 --- a/examples/explore_db.clj +++ b/examples/explore_db.clj @@ -32,7 +32,7 @@ (defn batch-entity [batch-id] - (str/replace batch-id #"-.*" "")) + (str/replace batch-id #"-[^-]*$" "")) (->> (client/q conn {:query '[:find ?id :where [_ :mbrainz.initial-import/batch-id ?id]]