Skip to content

Instantly share code, notes, and snippets.

@udacityandroid
Created December 17, 2015 00:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save udacityandroid/6770270e7b3fd26f046f to your computer and use it in GitHub Desktop.
Save udacityandroid/6770270e7b3fd26f046f to your computer and use it in GitHub Desktop.
Firebase - Lesson 4 - New Database Schema Design
{
"sharedWith" : {
"<list pid>" : {
"<person to share with email>" : {
"email" : "the user's encoded email; this should match the key",
"hasLoggedInWithPassword" : true,
"name" : "the first and last name of the user",
"timestampJoined" : {
"timestamp" : 1447801490493
}
}
}
},
"shoppingListItems" : {
"<shopping list pid>" : {
"<item pid>" : {
"bought" : true,
"boughtBy" : "the encoded email of the user who bought the item",
"itemName" : "the item's human readable name",
"owner" : "the encoded email of the item's creator"
}
}
},
"userFriends" : {
"<user email>" : {
"<friend email>" : {
"email" : "the user's encoded email; this should match the key",
"hasLoggedInWithPassword" : true,
"name" : "the first and last name of the user",
"timestampJoined" : {
"timestamp" : 1447801490493
}
}
}
},
"userLists" : {
"lylafish@gmail,com" : {
"<list pid>" : {
"listName" : "the human readable name for the shopping list",
"owner" : "the encoded email of the list owner",
"timestampCreated" : {
"timestamp" : 1448321875922
},
"timestampLastChanged" : {
"timestamp" : 1448322115479
},
"usersShopping" : {
"<shopper email>" : {
"email" : "the user's encoded email; this should match the key",
"hasLoggedInWithPassword" : true,
"name" : "the first and last name of the user",
"timestampJoined" : {
"timestamp" : 1447801490493
}
}
}
}
},
"onecooldude@gmail,com" : {
"<list pid>" : {
"listName" : "the human readable name for the shopping list",
"owner" : "the encoded email of the list owner",
"timestampCreated" : {
"timestamp" : 1448321875922
},
"timestampLastChanged" : {
"timestamp" : 1448322115479
},
"usersShopping" : {
"<shopper email>" : {
"email" : "the user's encoded email; this should match the key",
"hasLoggedInWithPassword" : true,
"name" : "the first and last name of the user",
"timestampJoined" : {
"timestamp" : 1447801490493
}
}
}
}
},
"swordstress@gmail,com" : {
"<list pid>" : {
"listName" : "the human readable name for the shopping list",
"owner" : "the encoded email of the list owner",
"timestampCreated" : {
"timestamp" : 1448321875922
},
"timestampLastChanged" : {
"timestamp" : 1448322115479
},
"usersShopping" : {
"<shopper email>" : {
"email" : "the user's encoded email; this should match the key",
"hasLoggedInWithPassword" : true,
"name" : "the first and last name of the user",
"timestampJoined" : {
"timestamp" : 1447801490493
}
}
}
}
},
"americanguyw1521@gmail,com" : {
"<list pid>" : {
"listName" : "the human readable name for the shopping list",
"owner" : "the encoded email of the list owner",
"timestampCreated" : {
"timestamp" : 1448321875922
},
"timestampLastChanged" : {
"timestamp" : 1448322115479
},
"usersShopping" : {
"<shopper email>" : {
"email" : "the user's encoded email; this should match the key",
"hasLoggedInWithPassword" : true,
"name" : "the first and last name of the user",
"timestampJoined" : {
"timestamp" : 1447801490493
}
}
}
}
}
},
"users" : {
"<user email>" : {
"email" : "the user's encoded email; this should match the key",
"hasLoggedInWithPassword" : true,
"name" : "the first and last name of the user",
"timestampJoined" : {
"timestamp" : 1447801490493
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment