Jeremiah Olugbola
Posts: 0
Joined: Thu Mar 12, 2015 12:49 am

Arrays & Objects Backend

Hi I was wondering if someone can be of help! I am trying to create a sort of task management app for parties.
I would like to a user to select an option from a list (i.e party type) and it returns a set of predefined tasks for the user. I'm wondering how I can establish this from a back-end point of view. Would I need to create a tasks collection and have the tasks stored into an array in an object column? Or have a partytype collection that has an array of the different tasks for each party type?

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

Arrays & Objects Backend

Personally - I believe this is a bit of a question on style and using Mongodb they way it was designed - v the way it works best.

So - I'd vote for a collection with your party_types in it (id, party_type_abbreviation, and a description of the party type - and I'd have a second collection called party_tasks (suggestion), and you have columns for task abbr, task name , and a column for party_type_id where you store the related id from the party_types - and when displaying the list of tasks - you use a where clause to limit the rows that come back == ( the party_type_id in the part_tasks === the id from the party_types table).

Easy to manage that through storing local_storage values , etc.

Just an opinion. To me - it's very messy dealing with the embedded arrays in a column with varying lengths - and hard to code.

Bruce

Jeremiah Olugbola
Posts: 0
Joined: Thu Mar 12, 2015 12:49 am

Arrays & Objects Backend

Hi Bruce I'm a little bit new to using the Mongodb implementation..how would I link the party_type_id from one collection to the party_type collection?

Jeremiah Olugbola
Posts: 0
Joined: Thu Mar 12, 2015 12:49 am

Arrays & Objects Backend

I know its to do with pointers, however im not sure on how to link a certain column of another collection

Return to “Issues”