Taglist api returns a null string when an article exists without a taglist + performance once db grows
quantuminformation opened this issue · 1 comments
quantuminformation commented
quantuminformation commented
Also, this query will retrieve every taglist from every article. Would it not be better to filter them at the db level instead of performing the filtering on the cloud function.
async getAllTags() {
const tags = (await ds.createQuery(namespace, 'Article').select('tagList').run())[0];
const dedupeObj = {};
for (let i = 0; i < tags.length; ++i) {
dedupeObj[tags[i].tagList] = 1;
}
return Object.keys(dedupeObj);
},