Created
June 11, 2014 14:11
-
-
Save francolaiuppa/9c02a490111ba6437f94 to your computer and use it in GitHub Desktop.
How do I store statuses vs children data like comments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// each var is a collection | |
var ticketStatuses = [ | |
{ 'id': ObjectId(), 'name': 'Pending', 'alias': 'pending' }, | |
{ 'id': ObjectId(), 'name': 'In Progress', 'alias': 'in-progress' }, | |
{ 'id': ObjectId(), 'name': 'Done', 'alias': 'Done' }, | |
]; | |
var tickets = [ | |
{ | |
'id': ObjectId(), | |
'description': 'Bla bla bla', | |
'statusId': ObjectId('one_of_the_objectIds_that_come_from_the_collection_above'), | |
'comments': [ | |
{ 'id': ObjectId(), 'userId': ObjectId('user_id_goes_here'), 'comment': 'Bla bla bla', 'date': 'date_goes_here' } | |
] | |
} | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment