0

I'm new in Mean Stack workflow and my background relays on MySql schemas.

I'm creating a little application to improve my skills on it, and I've encountered a logic question.

I've created two Schemas: a User schema and a Ticket schema. Now I've to save extra info in the relation between the two Schemas: in MySql, I used junction tables (user_tickets in Laravel case) where I could store, for example, when a user opens a ticket, or if a user hides a ticket and so on...

In Mongoose and in Mean Stack world I can't find a solution. Now I've created a third model UserTickets but it's problematic and expensive to maintain the third model.

Am I wrong? Is there another simpler method?

Mika Sundland
  • 18,120
  • 16
  • 38
  • 50

1 Answers1

1

I think that embedded documents (Mongoose Sub Docs) can be a good solution for you. Maybe this can help you:

Mongoose Sub Docs

MongoDB and joins

MongoDB Joins with MongooseJS

Mongoose/mongoDB query joins.. but I come from a sql background

Community
  • 1
  • 1
Paulo Alexandre
  • 764
  • 1
  • 9
  • 20