I am looking to retrieve an array of objects containing sources from Firebase, organized by category. The structure of my Firebase data is as follows: view image here
Each authenticated user has their own array of sources with security rules for the database outlined here: view image here Every source consists of an array of articles and belongs to a specific category. I have used Vuefire to bind to the Firebase database. I've set up the initial code below, but I'm unsure about the next steps to group all sources by category.
var sources=[];
var db=firebase.database();
var id=auth.user().uid;
var userDb=db.ref(id);