How to look up several in mongo

> db.zhipin_cookie.find()[0]
{
    "_id" : ObjectId("5c3e89b5cfab5493e7c04e1c"),
    "cookie" : [
        "_umdata=C234BF9D3AFA6FE77F94838529E088A9BBD97FE15A9C993647E1BA8899EBCF18025B4DFBCA9E6B73CD43AD3E795C914C12AFE595899E431C947FA6E1ED7DEB3B; _uab_collina=154056544968891366026752; JSESSIONID=\"\"; __c=1544930213; __g=-; __l=l=%2Fwww.zhipin.com%2Fjob_detail%2F0fa6383a3ce0cd951XR92dm_E1Q~.html&r=https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DmViDrfNXobBzHXLDRAMNB7UvOwByvB88ZEiALvXHu01RdCvB1_SFi8P9S6rfx7H4kc2WoT2-WLQ0-x-A4HFchKcom5EK8ofnYQ7Snen7sbG%26wd%3D%26eqid%3D8b4d317e00010687000000035c15c3a1; lastCity=101030100; Hm_lvt_194df3105ad7148dcf2b98a91b5e727a=1547429880,1547429955,1547444163,1547515045; toUrl=https%3A%2F%2Fwww.zhipin.com%2Fgongsi%2F; Hm_lpvt_194df3105ad7148dcf2b98a91b5e727a=1547601953; __a=85347837.1534956138.1539538585.1544930213.643.4.587.643",
        "__a=75861541.1547056683.1547056683.1547056687.438.2.437.438; Hm_lvt_194df3105ad7148dcf2b98a91b5e727a=1547056684,1547056752,1547195723; t=9PbhtSZ64hnq0qnh; wt=9PbhtSZ64hnq0qnh; sid=sem_pz_bdpc_dasou_title; __g=sem_pz_bdpc_dasou_title; __c=1547056687; lastCity=101210100; __l=r=https%3A%2F%2Fwww.zhipin.com%2F%3Fsid%3Dsem_pz_bdpc_dasou_title&l=%2Flogin.zhipin.com%2F%3Fka%3Dheader-login&g=%2Fwww.zhipin.com%2F%3Fsid%3Dsem_pz_bdpc_dasou_title; Hm_lpvt_194df3105ad7148dcf2b98a91b5e727a=1547557715"
    ]

mongo  

May.05,2022

find (query condition) followed by .count ()


db.zhipin_cookie.aggregate ([

)
{$match: {...}},
{$addFields: {size: {$size: "$cookie"}}}

])
about & dollar;addFields and & dollar;size
it's better to write size as a field when writing an array without having to toss around at run time.

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