question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

N:M Check associations is not working as mentioned in the docs

See original GitHub issue

What are you doing?

// code here
From Sequelize docs
// check if all associated objects are as expected:
// let's assume we have already a project and two users
project.setUsers([user1, user2]).then(() => {
  return project.hasUsers([user1]);
}).then(result => {
  // result would be false
  return project.hasUsers([user1, user2]);
}).then(result => {
  // result would be true
})

What do you expect to happen?

It must work as documented

What is actually happening?

Not working as documented

// Example Scenario
Returns true instead of false for this scenario
If project as 2 users user1, user2
project.hasUsers([user1]);  // => returns true instead of false

__Dialect : Mysql __Database version: 5.7 __Sequelize version:__4.13.5

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

github_iconTop Results From Across the Web

SequelizeJS N:M Check associations is not working as ...
This example from sequelizeJS docs is not working as mentioned. Here is the link. // check if all associated objects are as expected: ......
Read more >
Advanced M:N Associations | Sequelize
This shows that one Many-to-Many relationship isn't very different from two One-to-Many relationships. The tables in the database look the same. The only ......
Read more >
Home - NM RLD
Verify a license​​ Verify your professional is licensed before using their services. Check if they have any disciplinary actions against them.
Read more >
Inspection of Public Records Act - New Mexico Attorney General
“public records” means all documents, papers, letters, books, maps, tapes, photographs, recordings and other materials, regardless of physical form or ...
Read more >
Corporations and Business Search - SOS Portal
Registration/Reservation No.: ... Welcome to the Business Search screen where you may search for entities registered in New Mexico. In order to search...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found