2.0.0(preview)

This commit is contained in:
masnn committed 2020-06-08 13:41:43 +08:00
1 parent d5929d78b1
commit 1c8b62a6d9
33 files changed
+307 -241

No files matched your search

+8
View File
@@ -190,6 +190,13 @@ async function setStatus(domainId, docType, docId, uid, args) {
return res.value;
}
function setMultiStatus(domainId, docType, query, args) {
return collStatus.updateMany(
{ domainId, docType, ...query },
{ $set: args },
);
}
async function setIfNotStatus(domainId, docType, docId, uid, key, value, ifNot, args) {
const res = await collStatus.findOneAndUpdate(
{
@@ -351,6 +358,7 @@ global.Hydro.model.document = module.exports = {
set,
setIfNotStatus,
setStatus,
setMultiStatus,
setSub,
TYPE_DOMAIN_USER,