MongoDB: SELECT the const ?
Is it possible in MongoDB to create a query similar to the SQL version:
SELECT 1 as num, username FROM 'users' LIMIT 1?
(Task: you must specify a value in the query to get it as a result)
asked October 8th 19 at 01:00
In 2.2 you can use $project. Now this method I don't know. Can you specify the problem? Why get the same pitch as at the entrance.
Apparently requires a temporary placeholder while designing/development of the project or connect to an existing database, the structure of which is not correct.
Universal solution — make a view in the database, which add the desired fields.
Find more questions by tags MongoDB