Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4826

Ember relationships and mongo relationships

$
0
0

@Joao_Calvin wrote:

I'm trying to figure out the best approach to my Ember App.

I'm working with two models: events and bookings, and in my database, I structured they totally separate and independent from each other.

Schemas:

Events:

attributes:
  date        : Date
  description : String
  hiw         : Object
  hour        : Date
  meeting     : String
  men         : Number
  name        : String
  women       : Number

  createdAt   : Date
  updatedAt   : Date

  isActive    :
    type    : Boolean
    default : false

type:
  type    : String
  default : 'event'

Bookings:

attributes:
  email         : String
  idiom         : String
  name          : String
  obs           : String
  participants  : Number
  phone         : String
  sex           : String
  vip           : String

  createdAt    : Date
  updatedAt    : Date

  isActive     :
    type    : Boolean
    default : false

type:
  type    : String
  default : 'booking'

As I'm learning Ember, I discovered that ember has relationships (belongsTo and hasMany), and I would like to ask if I should restructure my schemas to deal with Ember data, or if I should make them independent as i'm doing.

The tendency of bookings is be progressively more complex over time..

The Ember data relationships is for this kind of stuff, or is to simple things like, comments in posts.. etc. etc..

Thank you!

Posts: 5

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4826

Trending Articles