Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6166185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:17:43+00:00 2026-05-23T22:17:43+00:00

Can I create relationships between my object stores in IndexedDB? For example, I have

  • 0

Can I create relationships between my object stores in IndexedDB?

For example, I have two object stores: artist and album. An artist has a one-to-many relationship with an album. album.artistId relates the album to artist.id.

I’m thinking along the lines of Hibernate here. I would like to do a query for artists and have the albums belonging to that artist returned as an array called artists on the album object.

artist.albums = [];

Follow Up (4.5 years later, 2017)

There are some great answers below that answer the question very well. I’d like to add that I was originally trying to use IndexedDB as a relational store and build an ORM-like solution on top of it, which it is not suited for. IndexedDB is a NoSQL database and since I’ve started treating it that way it’s made more sense and my projects easier to manage. I hope this adds some value to the original question for those who continually come across it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T22:17:44+00:00Added an answer on May 23, 2026 at 10:17 pm

    The indexedDB provides low level methods to create, read, update, and delete (CRUD) “records” of objects. But the standard does not define specific methods for relational operations. The goal was to keep the standard simple and allow developers to implement the higher-level functions in any way they saw fit. However, what you’re asking for is still attainable through a small amount of development on your part.

    To help things out, Parashuram Narasimhan wrote a Jquery implementation for indexedDB that will finish the job for you.

    Jquery indexedDB Example 1

    Jquery indexedDB Example 2

    Consider the following generalized possibility:

    $.indexeddb("MyDatabase")
      .objectStore("Artist")
      .openCursor()
      .each(function(){
        //Got Artist
        //Enumerate for Albums
        $.indexeddb("MyDatabase")
          .objectStore("Artist")
          .openCursor()
          .each(function(){
            //Check for matching artist.Id
            //if this albums's artist matches artist
            //then do something
            }
          ;
        }
      ;
    

    A little late for an answer, but I hope it helps grease the gears a bit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the best way to create a one to many relationship between two
One can create an anonymous object that is initialized through constructor parameters, such as
I'm trying to create a very simple relationship between two objects. Can anybody explain
I have a one-to-one unidirectional relationship between a Booking object and an Address object
Let's say you have a one-to-many relationship between Users and Orders (where one user
Can anyone help? I have a created a relationship between my Reservation(prim key) and
I have created two separate objects, one of class Order and one of class
I have an identifying relationship between two tables in the database. The parent table
If I a many-to-many relationship between Users and Roles and I have an instance
I have many-to-many relationship between Game and Account models like below: class Account <

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.