今天遇到一个问题,就是在 mongodb 修改 cookie 的值 因为 cookie 的值太长, 于是我这样
db.coolection.update({"cookie":"kr_stat_uuid=s83pP25734456; download_animation=1; device-uid=9447e910-f90a-11e8-85f3-853e28e448cb; kr_plus_id=643809727; krnewsfrontss=e88ee1dafbc74062e5286b2ad050d1c2; M-XSRF-TOKEN=955cda13b9df340725a9f6ae46bc3dd467969129c4e71424c9723edcf4989b26; krnewsfrontcc=eyJ0eXAiOiJKV1QiLCJhbGciOiIzNmtyLWp3dCJ9.eyJpZCI6MTA5MjU0OTQ0NSwic2Vzc2lvbl9pZCI6ImU4OGVlMWRhZmJjNzQwNjJlNTI4NmIyYWQwNTBkMWMyIiwiZXhwaXJlX3RpbWUiOjE1NzY5MjAwOTB9.06bc5b3743abdd862451a739a13ffe0b52128c0e4d6dbcec251191814055700e; kr_plus_utype=0; Hm_lvt_1684191ccae0314c6254306a8333d090=1544420094,1544498178,1544514883,1545384091; Hm_lvt_713123c60a0e86982326bae1a51083e1=1544420094,1544498178,1544514883,1545384092; Hm_lvt_e8ec47088ed7458ec32cde3617b23ee3=1544067381,1545384189; kr_p_se=c797cd2a-c544-46f5-b480-95168f91d953; krid_user_id=643809727; krid_user_version=2; kr_plus_token=9hDrv3NZrGA3KX3GeFU963hC1IRE6gWmz5a____; Hm_lpvt_e8ec47088ed7458ec32cde3617b23ee3=1545384194; _ga=GA1.2.1819701447.1545384194; gid=GA1.2.2007305715.1545384194; gr_user_id=db313a76-07b8-4d53-b244-fc04f5648ba0; gr_session_id_76d36bd044527820a1787b198651e2f1=6577c323-76c4-4de0-937d-80dbde1021d5; gr_session_id_76d36bd044527820a1787b198651e2f1_6577c323-76c4-4de0-937d-80dbde1021d5=true; Z-XSRF-TOKEN=eyJpdiI6ImF1MEhXR09lcHRBQ2puTUJ1R1ltYkE9PSIsInZhbHVlIjoieGdrZWQzNThUdUcwVTZCVk1laW9MTG1pQXJPRnUrUnlSSXpiQ2Q4d1k3Vk9wQmI1YkhNNGdIM3VVZkZ3dVpsMGV2OUFJSldEck9ldWgxenNcL25KeU1nPT0iLCJtYWMiOiI4MThjMTI5ODIzZmYyNGVhOTJmMTQ5MGZlYWIxYzQ1YWZjNWJkYzRiMzkwMjU5MmVjMmY2NGIyMmE1MzA2NGYxIn0%3D; krchoasss=eyJpdiI6InAzdTZvQk5nYXFRdzE4WWc4cGpndnc9PSIsInZhbHVlIjoicGJuWXU2a21ZYjd4anA0bjF4azlqWEo2RUJINUxRYXRra0dON0JcL3VFZHJqbG8yVXBQeUFGcnZSeW40ZWxxbmNtTlwvSERwRVFrazduc2N6bGJjNkZGUT09IiwibWFjIjoiMmIyYzQ1ZjljZmI0MDU0N2NhMmE0NTQ5Y2IzZjMwNGQxZTZlMGQyOTJhYjMxNDk1MzQ3ODRiNTMyOWY5MGUyMiJ9; sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%22643809727%22%2C%22%24device_id%22%3A%2216781a6b6eb731-02acab268c12f2-163b6953-1296000-16781a6b6ec18d%22%2C%22props%22%3A%7B%22%24latest_traffic_source_type%22%3A%22%E7%9B%B4%E6%8E%A5%E6%B5%81%E9%87%8F%22%2C%22%24latest_referrer%22%3A%22%22%2C%22%24latest_referrer_host%22%3A%22%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC%E7%9B%B4%E6%8E%A5%E6%89%93%E5%BC%80%22%7D%2C%22first_id%22%3A%2216781a6b6eb731-02acab268c12f2-163b6953-1296000-16781a6b6ec18d%22%7D; Hm_lpvt_1684191ccae0314c6254306a8333d090=1545385052; Hm_lpvt_713123c60a0e86982326bae1a51083e1=1545385052"},{$set:{"cookie":"xxxx"}})
我感觉这样复制 cookie 很不方便,求人指教,有没有简便方法更新 mongo 里面的某个 value 值?
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.