Sequelize – SQL Server – order by for association tables

From Sequelize offical docs: // Will order by an associated model’s created_at using an association object. (preferred method) [Subtask.associations.Task, ‘createdAt’, ‘DESC’], // Will order by a nested associated model’s created_at using association objects. (preferred method) [Subtask.associations.Task, Task.associations.Project, ‘createdAt’, ‘DESC’], By referring above syntax, Update your order option like below User.findById(uID, { include: [{ model: sequelize.models.userProfile … Read more

Using promises with streams in node.js

In this line stream.on(“end”, resolve(stream.dests[0].path)); you are executing resolve immediately, and the result of calling resolve (which will be undefined, because that’s what resolve returns) is used as the argument to stream.on – not what you want at all, right. .on‘s second argument needs to be a function, rather than the result of calling a … Read more

Get the Value of HTML Attributes Using Puppeteer

You can get attribute value with evaluate method. await page.evaluate(‘document.querySelector(“span.styleNumber”).getAttribute(“data-Color”)’) Second way $$eval method can also be used. Also attributes called as Array from variable const attr = await page.$$eval(“span.styleNumber”, el => el.map(x => x.getAttribute(“data-Color”))); Output will be [“Blue”, “Green”, “Red”] Your solution const styleNumbers = await page.$$(“span.styleNumber”); for( let styleNumber of styleNumbers ) { … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)