https://s2-labs.com/developer-tutorials/count-query/