The name of the field found by mongoose custom

1. Write some mini applications with node recently. Using mongoose. There is a small problem. Do not understand (may not understand the English document or do not understand).

for example:

    video.find({},(err, videos) => {
        videos.forEach(val => {
            val.videoId = val._id;
            delete val.id;
        })
    })

find a normal method. Or can you tell me where it is in the document? I really don"t understand how to do it.

Feb.28,2021

video.find ({},'- id',function (err,doc) {})
the second parameter is a string, add-do not return id, do not add-only return id, multiple fields
http://mongoosejs.com/docs/ap.


https://codeshelper.com/a/11.

I wonder if this article can solve the problem of the landlord.


video.aggregate (). Project ({videoId: "$_ id"}). Exec ();
so OK

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b9badf-2f294.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b9badf-2f294.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?