How to reference another table using MySQL in Nodejs

I'm editing an app that uses NodeJS and MySQL.

I would like to make a reference from a table (album) to another (photo). (A album will have photos...)

When using Nodejs + Mongo, we use mongoose.Schema and type: Schema.Types.ObjectID, ref: "Schema_name" in the model file. But how I can do it when using Mysql?

Read more here:

Content Attribution

This content was originally published by Gabriel Donada at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: