Mongodb extract subarray

for example, multiple documents with the following format (only one is written below):

[
    // key
{
"subkey1": ...,
"subkey2": ...,
"subkey3": ...
},
{
"subkey1": ...,
"subkey2": ...,
"subkey3": ...
},
...
]

if there is an example of node.js "s mongodb library code, it would be even better ^ _ ^

May.05,2022
Using find ({query criteria}, {key:1}, function () {}) in

mongoose can only return key, but a single document is still in the form of an object, that is, {"key": [.]}.


the size of a single document cannot exceed 16MB, so it is obviously unrealistic and not recommended to put all of them in one document. If you want to follow certain conditions, you need to do $group , then you have to decide what conditions to follow $group

.
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-1e5b6c6-45639.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-1e5b6c6-45639.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?