How can count true or false propierties on DB

Check this.