'use strict'; /** * Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/services.html#core-services) * to customize this service */ module.exports = { distinctbyKey: async (params) =>{ const results = await strapi.query('message').find(params); let arrKeys = []; results.forEach((i)=>{ if(!arrKeys.includes(i["session_datum_key"])) arrKeys.push(i["session_datum_key"]); }); return arrKeys } };