entityService filters with relation data v4

If you want to find entries where a relationship does not exist, this snippet worked for me. (based on @GregorSondermeier)

const findRelationshipNull = async (collection: string, relationship: string) => {
  const strapiApi = `api::${collection}.${collection}`;

  return await strapi.query(strapiApi).findMany({
    populate: [relationship],
    where: {
      $or: [{[relationship]: {id: {$null: true}}}],
    },
  });
};