var db_me = new Dexie("UI_LANGUAGE");
db_me.version(1).stores({
languages: "++id,&code,title",
words: "++id,language_id,index_name,title"
});
I want language_id and index_name to be unique together as a pair. Is that possible in Dexie ? & makes them unique but individually not as a pair.
It sounds like you want to use a compound index (http://dexie.org/docs/Compound-Index). Check also the browser limitations on that page
@nponiros but then when doing a where with only using language_id i get KeyPath language_id on object store words is not indexed.
For workaround im using another language_id_2 and using it to lookup in where query. is there any better way ?
You can index them both together and separate without having to use a new property
db_me.version(1).stores({
languages: "++id,&code,title",
words: `
++id,
language_id,
&[language_id+index_name],
index_name,
title
`;
});
Most helpful comment
You can index them both together and separate without having to use a new property