Arun Tyagi Arun Tyagi - 8 months ago 25
Node.js Question

find elements on basis of array of input Mongoose

Model is

UserSchema = new Schema({
email: String,
isActive: { type: Boolean, 'default': true },
createdAt: { type: Date, 'default': }
module.exports = mongoose.model('User', UserSchema);

Now I have a list of string, which listt of [ erp_user_id], i want to search all users with erp_user_id contains in this list.

something like

var inputArray = ['1234','324324','54345'];

user;// <---- list of users expected result

var inputArray = ['1234','324324','54345'];

user;//  <---- list of users expected result