notification to subscribers on groups
This commit is contained in:
@@ -39,6 +39,15 @@ const getDB = new Promise((resolve, reject) => {
|
||||
return DB.usersCol.findOne({ _id });
|
||||
}
|
||||
|
||||
let usernamesCache = {}
|
||||
DB.getUsernameByIdCache = async (userid)=>{
|
||||
if(usernamesCache[userid]) return usernamesCache[userid];
|
||||
const _id = new mongo.ObjectID(userid);
|
||||
let user = await DB.usersCol.findOne({ _id });
|
||||
usernamesCache[userid] = user.username;
|
||||
return usernamesCache[userid];
|
||||
}
|
||||
|
||||
DB.newUser = (userInformation)=>{
|
||||
return DB.usersCol.insertOne(userInformation).catch((err)=>{
|
||||
console.log(err);
|
||||
|
||||
Reference in New Issue
Block a user