Skip to content

Instantly share code, notes, and snippets.

@1dolinski
Created August 31, 2016 13:00
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 1dolinski/e6c97c6af6c636134cd20a02d2239a27 to your computer and use it in GitHub Desktop.
Save 1dolinski/e6c97c6af6c636134cd20a02d2239a27 to your computer and use it in GitHub Desktop.
// Goal1: get activites for user for particular date
// Goal2: get most recent activites in the database for reporting
// Match: UID and startDate
// 2 options
// a. pushed objects
// not sure how to query for both uid AND startDate
// easy to achieve goal 2
z = {
activities: {
pushid: {
startDate: 123456,
createdAt: 1231832789,
uid: '-k23v39vxoqlknv9'
}
}
}
// b. uid with pushed objects
// faster reads for a user
// easy to achieve goal 1
// not sure how to achieve goal 2 when multiple users are included
a = {
activities: {
'-k23v39vxoqlknv9': { // this is the $uid
pushid: {
startDate: 123456
createdAt: 1231832789
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment