Allowing start end key syntax to be used outside of tenancy if we need to.

This commit is contained in:
mike12345567 2021-12-10 15:17:18 +00:00
parent 312db6182d
commit ce3d7df39d
1 changed files with 3 additions and 2 deletions

View File

@ -199,8 +199,9 @@ exports.getCouchUrl = () => {
return `${protocol}://${env.COUCH_DB_USERNAME}:${env.COUCH_DB_PASSWORD}@${rest}` return `${protocol}://${env.COUCH_DB_USERNAME}:${env.COUCH_DB_PASSWORD}@${rest}`
} }
exports.getStartEndKeyURL = (base, baseKey, tenantId = "") => { exports.getStartEndKeyURL = (base, baseKey, tenantId = null) => {
return `${base}?startkey="${baseKey}${SEPARATOR}${tenantId}"&endkey="${baseKey}${SEPARATOR}${tenantId}${UNICODE_MAX}"` const tenancy = tenantId ? `${SEPARATOR}${tenantId}` : ""
return `${base}?startkey="${baseKey}${tenancy}"&endkey="${baseKey}${tenancy}${UNICODE_MAX}"`
} }
/** /**