use mongoose autopopulate

This commit is contained in:
Flam3rboy 2021-04-07 20:26:09 +02:00
parent 193e3f5a2c
commit d3d733a975
2 changed files with 1 additions and 4 deletions

BIN
package-lock.json generated

Binary file not shown.

View File

@ -10,12 +10,12 @@ import {
ReadyEventData,
UserModel,
toObject,
EVENTEnum,
} from "fosscord-server-util";
import { setupListener } from "../listener/listener";
import { instanceOf } from "lambert-server";
import { IdentifySchema } from "../schema/Identify";
import { Send } from "../util/Send";
import { EVENTEnum } from "fosscord-server-util";
import experiments from "./experiments.json";
import { check } from "./instanceOf";
@ -62,9 +62,6 @@ export async function onIdentify(this: WebSocket, data: Payload) {
};
const guilds = await GuildModel.find({ id: { $in: user.guilds } })
.populate("channels")
.populate("roles")
.populate("emojis")
.populate({ path: "joined_at", match: { id: this.user_id } })
.exec();