Click here to Skip to main content
15,884,018 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
If user created an account, he can choose his languages, we have two tables:
1. languages: language_id, language_name
2. user_languages: user_id, language_id

If the user chose languages already exists, we will add it to the 'user_languages' table
If it is not, we will add it first to the 'languages' table then link the id with user_id in the 'user_languages' table

How can I do this with sequelize?


What I have tried:

const createLanguages = (data) => Languages.create(data);
const createUserLanguages = (data) => UserLanguages.create(data);
Posted
Updated 8-Aug-21 2:06am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900