skip to Main Content

Display data from another collection in MongoDB

I have two separate collection in MongoDB 1-> Post, 2-> Comment. Post-schema: const postSchema = new mongoose.Schema( { userId: { type: mongoose.Schema.Types.ObjectId, ref: "User", required: true, }, media: { type: [mongoose.Schema.Types.Mixed], trim: true, required: true, }, text: String, mentions: {…

VIEW QUESTION

mongoDB collection creation

i have a problem with adding a collection into my database in mongodb atlas. I have managed to import this collection before but i accidentally deleted it and now i can't upload it again. there is no error in my…

VIEW QUESTION

Mongodb – Aggregation $match within a $sum

I was wondering if it was possible to somehow use the $match operator within the $sum function for aggregation. { "$unwind": "$info.avatarInfoList" }, { "$unwind": "$info.avatarInfoList.equipList" }, { "$unwind": "$info.avatarInfoList.equipList.flat.reliquarySubstats" }, { "$project": { "name" : "$name", "character" : "$info.avatarInfoList.avatarId",…

VIEW QUESTION
Back To Top
Search