Skip to content

Instantly share code, notes, and snippets.

@notflip
Last active November 30, 2018 16:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save notflip/3ebc6a692d589b49b0c9f09ae71310e4 to your computer and use it in GitHub Desktop.
Save notflip/3ebc6a692d589b49b0c9f09ae71310e4 to your computer and use it in GitHub Desktop.
NoSQL Model
"users": [
"user1": {
"id": "user1",
"username": "Notflip"
}
]
"categories": [
"category1": {
"name": "Productivity",
"paths_count": 5 // for sorting, update via cloud functions
}
]
"paths": [
"path1": {
"name": "Path 1",
"user": {"username": "notflip"}
"likes_count": 2, // for sorting, update via cloud functions
"likes": ["user1"]
"categories": ["category1"] // Issue: this needs seconds query to fetch together with path
}
]
"comments": [
"comment1": {
"id": "comment1",
"path": "path1",
"commenter": "user1",
"comment": "I love this!",
"upvotes": 4
}
]
"courses": [
"course1": {
"id": "course1",
"path": "path1",
"content": "Course 1 content"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment