0

We wanted something similar with PostgreSQL where one can combine group by with having clause. For example, I want to find players with duplicate player_code

SELECT player_code
FROM public.player
GROUP BY player_code
HAVING COUNT(player_code) > 1;

How can I achieve such using Weaviate Aggregate? I only came up with this but could not find a way where to insert the WHERE part?

echo '{
  "query": "{
    Aggregate {
      Player(groupBy: [\"player_code\"]) {
        meta {
          count
        }
        groupedBy {
          value
          path
        }
      }
    }
  }"
}' | curl \
    -X POST \
    -H 'Content-Type: application/json' \
    -d @- \
    http://{{HOST}}/v1/graphql

Is this even possible? Perform aggregate query and use the meta > count in condition filter (e.g., use meta count GreaterThan 1) ?

junbetterway
  • 236
  • 3
  • 13

0 Answers0