Skip to content

Tag: node.js

returning extra column with formatted date

I have a schema(table) like following in seqluelize: My requirement is whenever I call or use or include this schema order_entry_header in any place in my app I want date column in to format in a readable text in a different column called date_format In simple sql this should be something like below: I am joi…

How to make object with variable-based values in node.js

What I’m trying to do is keep a database of users in an object so I can assign values to each user, however I can’t find out a way to do it. I’ve tried just doing var data = {} and then eval(`data.user_${user} = value`) but that only writes undefined. Any advice would be appreciated. Answer Try