Multiple collection join/concat query with Mongoose similar to union query in SQL

Viewed 62

I have 4 collection named students, teachers, stuffs and managers with same mongoose schema.

const schema = new Schema({
    name: String,
    age: Number,
    email: String
})

how can I retrieve all the students, stuffs, managers and teachers where their age>=25 within one query? data should be look like concatenated as in SQL performs in union query.

1 Answers
Related