diff --git a/api/source/service/AssetService.js b/api/source/service/AssetService.js index 1b890a70..bdc5539b 100644 --- a/api/source/service/AssetService.js +++ b/api/source/service/AssetService.js @@ -207,7 +207,7 @@ exports.queryAssets = async function (inProjection = [], inPredicates = {}, elev } if ( inPredicates.metadata ) { for (const pair of inPredicates.metadata) { - const [key, value] = pair.split(':') + const [key, value] = pair.split(/:(.*)/s) predicates.statements.push('JSON_CONTAINS(a.metadata, ?, ?)') predicates.binds.push( `"${value}"`, `$.${key}`) } diff --git a/api/source/service/CollectionService.js b/api/source/service/CollectionService.js index 90c24e8d..6538fc30 100644 --- a/api/source/service/CollectionService.js +++ b/api/source/service/CollectionService.js @@ -162,7 +162,7 @@ exports.queryCollections = async function (inProjection = [], inPredicates = {}, } if ( inPredicates.metadata ) { for (const pair of inPredicates.metadata) { - const [key, value] = pair.split(':') + const [key, value] = pair.split(/:(.*)/s) predicates.statements.push('JSON_CONTAINS(c.metadata, ?, ?)') predicates.binds.push( `"${value}"`, `$.${key}`) } diff --git a/api/source/service/ReviewService.js b/api/source/service/ReviewService.js index 5816c4e2..3fc79b45 100644 --- a/api/source/service/ReviewService.js +++ b/api/source/service/ReviewService.js @@ -776,7 +776,7 @@ exports.getReviews = async function (inProjection = [], inPredicates = {}, userO } if ( inPredicates.metadata ) { for (const pair of inPredicates.metadata) { - const [key, value] = pair.split(':') + const [key, value] = pair.split(/:(.*)/s) predicates.statements.push('JSON_CONTAINS(r.metadata, ?, ?)') predicates.binds.push( `"${value}"`, `$.${key}`) }