var map = {};
for (var categoryId in db_obj) {
if (!db_obj.hasOwnProperty(categoryId)) continue;
var entry = db_obj[categoryId];
for(var userId in entry) {
if(!entry.hasOwnProperty(userId)) continue;
if(!map.hasOwnProperty(userId)) {
map[userId] = [];
}
map[userId].push(categoryId);
}
}