-
Notifications
You must be signed in to change notification settings - Fork 1.5k
-
So for example in SQL we have the select user_id as id from users
using as so that it will return data with a property name id instead of user_id.
sample output:
$users = [ { id: 1 }, { id: 2 }, { id: 3 }, { id: 4 }, { id: 5 }, ]
How can this be done in lumen MongoDB? thanks 👍🏻
Beta Was this translation helpful? Give feedback.
All reactions
-
👎 1
Replies: 1 comment 1 reply
-
Hello,
Please stop spamming new issues, you're asking questions and that's the reason why they should go to discussions.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions
-
oh no sorry, I'm not trying to spam, I'm just trying to at least request a new feature because I am using this library and In the docs.
Im just trying to request a feature for alias.
like for example, I like to have a query something like this. So that it will be easy to automatically alias a column.
using AS.
$users =
User::where('user_id', '123')
})->get(['firstName AS name']);
return json_encode($users)
So instead of returning this
[
{
firstName: 'Mark'
},
{
firstName: 'John'
},
]
It will return something like this
[
{
name: 'Mark'
},
{
name: 'John'
},
]
Beta Was this translation helpful? Give feedback.