D
D
Deodatuss2015-12-05 13:00:14
JavaScript
Deodatuss, 2015-12-05 13:00:14

How to change field name in sails js when executing .find()?

Hello, actually the question is clear. I want to find an analogue of AS in .find() , but the search was not successful. Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Romanov, 2015-12-06
@Kaer_Morchen

Hello.
I'm not sure what will work, but try using AS in Model.query like

User.query('SELECT email, username AS name FROM users WHERE id = 10;', function (err, users) {
console.log(users);
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question