Example data structure:
{
"Site": "pasta.com",
"ID": 119318,
"Buyer": {
"ID": 5475630,
"Name": "potato"
}
}
Current Code:
static MigrateVersion2(db) {
const siteStore = db.createObjectStore('sites', {
keyPath: 'Site',
});
siteStore.createIndex('BuyerID', ['Buyer', 'ID']);
}
I need to use this store in IndexedDB to query by the site name, but I also need to be able to query by the buyer id. Is it possible for me to create an Index from the child object of the parent object that is stored in the database?
I saw a duplicate of this question but could not find the solution from it.