I need to make a many table for many in IndexedDB, where I have People Turmas and Turma_Pessoas, the person can participate in several groups, and several groups can have several students, there I created this table class person, where I put people code , class code, a flag to identify who the person in that class is. Here is the code for my table.
var pessoa turma = db.createObjectStore("tbl_PESSOA_TURMA", {keyPath: "COD_IDENT_TURMA"});
pessoa_turma .createIndex("COD_IDENT_PESSO", "COD_IDENT_PESSO", {unique: false});
pessoa_turma .createIndex("COD_IDENT_CELUL", "COD_IDENT_TURMA", {unique: false});
pessoa_turma .createIndex("FLG_IDENT_PESSO", "FLG_IDENT_PESSO", {unique: false});
pessoa_turma .createIndex("COD_IDULT_ATUAL", "COD_IDULT_ATUAL", {unique: false});
pessoa_turma .createIndex("DAT_ULTIM_ATUAL", "DAT_ULTIM_ATUAL", {unique: false});
With this code I am able to save only some part of the class, because the code of the group is suffering a group by, for example I have 16 people, and it appears only 3 classes, because these 16 people are in 3 different classes .
How do I accept the registration of more than one code? I need the class code to be a primary key, because in the class search I need it to return all the codes of people who have the class code 'X'.