mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
多worker共享事件(不稳定
This commit is contained in:
1 parent
d59710ddf1
commit
dd5a212422
9 files changed
+113
-20
No files matched your search
+5
-2
@@ -109,8 +109,11 @@ function setPassword(uid, password) {
|
||||
);
|
||||
}
|
||||
|
||||
function setById(uid, args) {
|
||||
return coll.findOneAndUpdate({ _id: uid }, { $set: args });
|
||||
function setById(uid, $set, $unset) {
|
||||
const op = {};
|
||||
if ($set && Object.keys($set).length) op.$set = $set;
|
||||
if ($unset && Object.keys($unset).length) op.$unset = $unset;
|
||||
return coll.findOneAndUpdate({ _id: uid }, op);
|
||||
}
|
||||
|
||||
function setEmail(uid, mail) {
|
||||
|
||||
Reference in new issue
Block a user