android - Alternate to group by in realm -


i have realmobject class video game info contains multiple

 realmlist<realmstring> variables; 

including developers , publishers , theme , genre etc . need group database according these realmlist variables can count of each value in realmlist , show statistics .

is there efficient way make query ?

here realmobject class

public class gamedetaildatabase extends realmobject  { @primarykey private int id; private string name; private realmlist<realmstring> developers; private realmlist<realmstring> franchises; private realmlist<realmstring> genres; private realmlist<realmstring> publishers; private realmlist<realmstring> similargames; private realmlist<realmstring> themes;   public gamedetaildatabase() { }  //setters , getters  } 

a game can have muti developers , multi genre , multi themes stored realmlist<realmstring> .

here realmstring class

public class realmstring extends realmobject {  private string name;  public realmstring(string name) {     this.name = name; }  public realmstring() { } } 

now let have 3 game records in database. game has developer a,b , c , game b has developer b,c,d , game c has developer b,c . want query data such count of game each developer. in case
- 1 game
b - 3 game
c - 3 game
d - 1 game

how efficiently using realm ?


Comments