-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindexnotes.txt
30 lines (28 loc) · 934 Bytes
/
indexnotes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Schema and index definitions:
-single collection: users
-single format:
{
_id: "ace" #username string, all lowercase TODO need to validate
salt: "asdfas" #salt string
hash: "afsad" #hash string
signupts: ISODate(...) #timestamp from when user was created
followers: [{
username: "follower" #follower name/id
followts: ISODate(...) #timestamp from when follower started following _id
}]
following: [{
username: "followee" #followee name/id
followts: ISODate(...) #timestamp from when _id started following followee
}]
links: [{
url: "google.com" #url for post
headline: "google" #headline for post
postts: ISODate(...) #timestamp for when post was created
}]
}
#TODO need to look over indexing strategy more
Indexes:
{_id: 1}
{followers.username: 1}
{following.username: 1}
{signupts: 1} #for intro page