Say I have this userSchema
:
const userSchema = new Schema({
firstName: {type: String, required: true},
lastName: {type: String, required: true},
email: {type: String, required: true, unique: true},
});
and this chatSchema
:
const chatSchema = new Schema({
user_ids: {type: [String]},
});
I wonder if I could do a search to get all chats from a user that has their user_id
inside chat's user_ids
and how could I do that.