Hello,
This is a 2-part queastion.
First, I'd like your input as to how you would design the data for these
requirements:

    - A user can have multiple lists, every list belongs to just one user
    (user <-->>list)
    - A list has multiple listItems, and a listItem can belong to multiple
    lists (list <<-->>listItem)
    - A listItem has multiple listItemLogs, and each listItemLog belongs to
    just one listItem (listItem <-->>listItemLog)

Important note: I really doubt that listItemLog should be an object, as
it's just one piece of data - a timestamp as epoch.

users:
/users/$userID/...

Lists:
/lists/$userID/$listID/...

listItems in list:
/listItems/$userID/$listID/$listItemID/true

listItems:
/listItems/$listItemID/...

listItemLogs:
  /listItemLogs/$listID/$listItemID/time:true


And second, while taking into consideration the data structure you offer,
how would you merge (in order to display using ngRepeat ) all listItems in
one list, with the logs of the past week (using moment.js to get the epoch
values for weeks start and end is trivial). Note that for performance
reasons, it's probably better to bind only one list's items, and only one
week's logs.

For example, if list "list1" has items "itemA" and "itemB", and itemA was
logged twice on that week, the list should show (in pseudo code) :

list1.title
----------
itemA.name
      itemA.logTime1
      itemA.logTime2
itemB.name
      n/a


I hope the question is clear, and thanks in advance!
P.S.
No problem using the latest versions (currently AngularFire is at 0.92)

--
You received this message because you are subscribed to the Google Groups "Firebase + AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-angular+unsubscribe@googlegroups.com.
To post to this group, send email to firebase-angular@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-angular/849fc803-e6ec-48b0-b922-7f4465a5a035%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Kato Richardson at Feb 3, 2015 at 1:30 am
    Hello there! Welcome to the group.

    This question is incredibly broad. In fact, we've written entire
    <https://www.firebase.com/docs/web/guide/> guides
    <https://www.firebase.com/docs/web/libraries/angular/guide.html> and
    some sophisticated
    example apps <https://www.firebase.com/docs/web/examples.html> that tackle
    similar issues.

    I'd start with those and circle back here with some specific, technical
    questions when you run into them.

    Cheers,
    Kato



    On Sun, Feb 1, 2015 at 2:23 AM, AngelEyes wrote:

    Hello,
    This is a 2-part queastion.
    First, I'd like your input as to how you would design the data for these
    requirements:

    - A user can have multiple lists, every list belongs to just one user
    (user <-->>list)
    - A list has multiple listItems, and a listItem can belong to multiple
    lists (list <<-->>listItem)
    - A listItem has multiple listItemLogs, and each listItemLog belongs
    to just one listItem (listItem <-->>listItemLog)

    Important note: I really doubt that listItemLog should be an object, as
    it's just one piece of data - a timestamp as epoch.

    users:
    /users/$userID/...

    Lists:
    /lists/$userID/$listID/...

    listItems in list:
    /listItems/$userID/$listID/$listItemID/true

    listItems:
    /listItems/$listItemID/...

    listItemLogs:
    /listItemLogs/$listID/$listItemID/time:true


    And second, while taking into consideration the data structure you offer,
    how would you merge (in order to display using ngRepeat ) all listItems in
    one list, with the logs of the past week (using moment.js to get the epoch
    values for weeks start and end is trivial). Note that for performance
    reasons, it's probably better to bind only one list's items, and only one
    week's logs.

    For example, if list "list1" has items "itemA" and "itemB", and itemA was
    logged twice on that week, the list should show (in pseudo code) :

    list1.title
    ----------
    itemA.name
    itemA.logTime1
    itemA.logTime2
    itemB.name
    n/a


    I hope the question is clear, and thanks in advance!
    P.S.
    No problem using the latest versions (currently AngularFire is at 0.92)

    --
    You received this message because you are subscribed to the Google Groups
    "Firebase + AngularJS" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to firebase-angular+unsubscribe@googlegroups.com.
    To post to this group, send email to firebase-angular@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/firebase-angular/849fc803-e6ec-48b0-b922-7f4465a5a035%40googlegroups.com
    <https://groups.google.com/d/msgid/firebase-angular/849fc803-e6ec-48b0-b922-7f4465a5a035%40googlegroups.com?utm_medium=email&utm_source=footer>
    .
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to firebase-angular+unsubscribe@googlegroups.com.
    To post to this group, send email to firebase-angular@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-angular/CADypTEb7xXVnNu5NgOQzsX7UZn%3DETm1Qt%2BxkahN%3DuBP7QcMnRw%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • AngelEyes at Feb 4, 2015 at 3:08 pm
    Hi, thank you!
    I'll take another look, though I did read most of that already...
    On Tuesday, February 3, 2015 at 3:30:54 AM UTC+2, Michael Kato Wulf wrote:

    Hello there! Welcome to the group.

    This question is incredibly broad. In fact, we've written entire
    <https://www.firebase.com/docs/web/guide/> guides
    <https://www.firebase.com/docs/web/libraries/angular/guide.html> and some sophisticated
    example apps <https://www.firebase.com/docs/web/examples.html> that
    tackle similar issues.

    I'd start with those and circle back here with some specific, technical
    questions when you run into them.

    Cheers,
    Kato




    On Sun, Feb 1, 2015 at 2:23 AM, AngelEyes <hanan....@gmail.com
    <javascript:>> wrote:
    Hello,
    This is a 2-part queastion.
    First, I'd like your input as to how you would design the data for these
    requirements:

    - A user can have multiple lists, every list belongs to just one user
    (user <-->>list)
    - A list has multiple listItems, and a listItem can belong to
    multiple lists (list <<-->>listItem)
    - A listItem has multiple listItemLogs, and each listItemLog belongs
    to just one listItem (listItem <-->>listItemLog)

    Important note: I really doubt that listItemLog should be an object, as
    it's just one piece of data - a timestamp as epoch.

    users:
    /users/$userID/...

    Lists:
    /lists/$userID/$listID/...

    listItems in list:
    /listItems/$userID/$listID/$listItemID/true

    listItems:
    /listItems/$listItemID/...

    listItemLogs:
    /listItemLogs/$listID/$listItemID/time:true


    And second, while taking into consideration the data structure you
    offer, how would you merge (in order to display using ngRepeat ) all
    listItems in one list, with the logs of the past week (using moment.js to
    get the epoch values for weeks start and end is trivial). Note that for
    performance reasons, it's probably better to bind only one list's items,
    and only one week's logs.

    For example, if list "list1" has items "itemA" and "itemB", and itemA was
    logged twice on that week, the list should show (in pseudo code) :

    list1.title
    ----------
    itemA.name
    itemA.logTime1
    itemA.logTime2
    itemB.name
    n/a


    I hope the question is clear, and thanks in advance!
    P.S.
    No problem using the latest versions (currently AngularFire is at 0.92)

    --
    You received this message because you are subscribed to the Google Groups
    "Firebase + AngularJS" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to firebase-angul...@googlegroups.com <javascript:>.
    To post to this group, send email to firebase...@googlegroups.com
    <javascript:>.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/firebase-angular/849fc803-e6ec-48b0-b922-7f4465a5a035%40googlegroups.com
    <https://groups.google.com/d/msgid/firebase-angular/849fc803-e6ec-48b0-b922-7f4465a5a035%40googlegroups.com?utm_medium=email&utm_source=footer>
    .
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to firebase-angular+unsubscribe@googlegroups.com.
    To post to this group, send email to firebase-angular@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-angular/a87ad5b8-5812-4bf8-8d52-0bbd4c17b7c3%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupfirebase-angular @
postedFeb 2, '15 at 5:23p
activeFeb 4, '15 at 3:08p
posts3
users2

2 users in discussion

AngelEyes: 2 posts Kato Richardson: 1 post

People

Translate

site design / logo © 2021 Grokbase