Connections between Ember and mongo databases

Currently, I am exploring the most effective approach for my Ember App.

I am dealing with two separate models: events and bookings. In my database, I have structured them in a completely independent manner.

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'

While learning Ember, I have come to understand that Ember offers relationships such as belongsTo and hasMany. I am unsure whether I should restructure my schemas to align with Ember or continue with my current independent setup.

The complexity of bookings is expected to increase over time.

Are Ember relationships designed for managing such intricate data structures or are they more suited for simpler tasks like handling comments on posts?

Thank you!

Answer №1

It's important to consider the interdependence of the components. If they rely on each other, incorporating relationships in both Ember.js and node.js would be beneficial. Utilizing mongoose can simplify the creation of relationships on the server side.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Improving JavaScript Functions: Minimize duplication of helper methods

I have a set of helper functions that check for the presence of specific strings in an array and certain steps before triggering other functions. The reason for keeping them separated is because arrTours must be associated with only those arrSteps. // Help ...

Transforming ASP.NET MVC IEnumerable view model into a JSON array of elements

My goal is to develop a dynamic calendar in ASP.NET MVC that pulls event data from a database to populate it. Right now, the calendar is set up to read a json array of objects, but I am facing an issue with converting my ViewModel data into a format that t ...

Creating a radial gradient effect using JavaScript

I've been experimenting with setting a radial gradient as the background of a div using JavaScript. My goal is to have the gradient start in the middle with around 0.8 opacity, gradually fading to 0 towards the edges to create a soft fading effect. I& ...

What is the best way to compare an array with comma-separated values in JavaScript?

I have a scenario where I have two arrays, one for categories and the other for products. Each product contains multiple categories as a comma-separated string. My goal is to match a specific category with each product's product_category value and the ...

What is the best way to retrieve the number of clients in a room using socket.io?

I am using socket.io version 1.3.5 My objective is to retrieve the number of clients in a specific room. This is the code implementation I have: socket.on('create or join', function (numClients, room) { socket.join(room); }); ...

Utilizing JavascriptExecutor to assign attribute based on name

When working with HTML that lacks an id and only has name, class, and tag attributes, it can be challenging to manipulate it using JavascriptExecutor. The name attribute is unique, while the other two attributes are common among various other elements in t ...

Searching within an array of objects in MongoDB to determine if a specific ID exists

Is it possible in MongoDB to retrieve all documents from one collection, excluding those that exist in another collection, without using aggregation? Let me provide more context: I have a collection called "Users", and another collection where there is a ...

Guidelines for properly storing user data post-login in Nuxt3

When a user logs in, I need to store their data for future use. I have middleware set up on the "/page" page to check if the user is logged in, and if so, it allows them through. However, I notice that the user data is lost when the page is refreshed. In t ...

AngularJS: Utilizing bold text to enhance the separation of concerns between controllers and templates

In my AngularJS version 1 application with Ecmascript 6, I have a requirement to display a string where one part is in normal weight and the other part is bold. For instance, consider the following scenarios: Will start now Will start in 6 minutes Will ...

The show/hide jquery function is functioning perfectly on desktop devices, but issues arise on mobile devices where the divs overlap each other when using the show() method

I need a way to toggle input text boxes based on selection using a select box This is the HTML code snippet: <div class="row"> <div class="form-group"> <div class="col-sm-1 label2"> <label class="control-label ...

Deciding on the proper character formatting for each individual character within the RICHT TEXT EDITOR

After browsing numerous topics on Stackoverflow, I was able to develop my own compact rich text editor. However, one issue I encountered is that when the mouse cursor hovers over already bold or styled text, it's difficult for me to identify the styl ...

Make the adjustment from an H1 tag to an H2 tag with the help of

I need assistance with changing the HTML code from using an <h1> tag to a <h3> tag, using Vanilla JavaScript. Here is the code snippet in question: <h1 class="price-heading ult-responsive cust-headformat" data-ultimate-target=" ...

Setting a displacement/normal map for only one face of a cylinder

My current setup involves creating a cylinder using the following code: var geometry = new THREE.CylinderGeometry( 50, 50, 2, 128 ); The resulting shape is a flat cylinder resembling a coin. However, when I apply a displacementMap and normalMap, I notice ...

How can one achieve a fading effect on the background using THREE.js?

I am attempting to achieve a fading effect on the drawing buffer while leaving trails of drawn objects, rather than clearing it every frame. It's a relatively simple effect that can be achieved in 2D using this code snippet: http://jsfiddle.net/faRW3/ ...

Incorporate real-time validation observables with the power of rxjs

Currently, I am working on implementing an observable for a validation task. There are 2 observables, frontEndValidate and backEndValidate, which I need to process sequentially in a specific order. If any of these observables throws an error, the entire pi ...

It appears that the use of '--link' command is not effective in establishing a connection between two Docker containers

I am trying to set up MongoDB in a container using the command below: docker run -p 27017:27017 --name cdt -d mongo After that, I want to run a server in a separate container with the following command: docker run --name foo --link cdt:mongo exec /bin/b ...

jQuery TextExt: Manage Content Height and Enable Scrollbar Functionality

I recently implemented the jQuery TextExt plugin (available at ) to create a language tagging input field, similar to how it's done on Facebook. On the whole, the plugin functions wonderfully. However, I've encountered an issue that has me stum ...

Using jQuery Modal Dialog with ASP.NET MVC 2

In my ASP.NET Mvc 2 application, I have a grid of user info. When a user is clicked, a jQuery Modal dialog opens allowing me to edit and save the user's information successfully. I am now looking for assistance on implementing validation on this moda ...

Creating a User Registration and Authentication System with JavaScript for a Database

I'm new to the world of web development and I've encountered a bit of a challenge. I'm looking for a Javascript framework that can handle user registration and authentication with a database, similar to what I would do with PHP and MySql. I ...

Ways to avoid a child element from overlapping another element

(I acknowledge that the question may sound a bit off, so please feel free to edit it if you can rephrase it better). So, I have this: jsFiddle As you can see, I'm attempting to recreate a basic Windows 7 aero effect (just for curiosity, fun, and lea ...