Arun Tyagi Arun Tyagi - 1 year ago 103
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

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

user;//  <---- list of users expected result
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download