add .lean to mongodb queries

This commit is contained in:
Flam3rboy
2021-04-06 04:30:07 +02:00
parent 6b61c86e3f
commit 509394b592
9 changed files with 106 additions and 63 deletions
+2
View File
@@ -48,6 +48,8 @@ export async function onIdentify(this: WebSocket, data: Payload) {
const channels = await ChannelModel.find({ recipients: this.user_id }).lean().exec();
const user = await UserModel.findOne({ id: this.user_id }).lean().exec();
if (!user) return this.close(CLOSECODES.Authentication_failed);
const public_user = {
username: user.username,
discriminator: user.discriminator,