Question: I got stuck at finding my value index in the array. I figured out how to check if my value exists in the array, but how to find index, i don't know. I searched through google, tried all other functions, didn't get any progress. So it would be awesome if anybody could explain and give some examples how to achieve my wanted results, thanks for your time.

```
public phrases[] sentences = new phrases[1];

    // STRUCT
public struct phrases
{
    public string key;
    public string value;
}

Array.FindIndex(sentences, key => key.value == "kaka");

```

Answer: 
You can add more than one validation like this:

```
var manyValidators = [
    { validator: isNotTooShort, msg: 'Is too short' },
    { validator: onlyLettersAllow, msg: 'Only Letters' }
];

var userSchema = new Schema({ 
    name: { type: String, validate: manyValidators },
    email: {type: String, required : true, validate: validateEmail },
    createdOn: { type: Date, default: Date.now },
    lastLogin: { type: Date, default: Date.now }
});

```
answer:

```
var isNotTooShort = function(string) {
  return string && string.length >= 5;
};

var onlyLettersAllow = function(string) {
  var myRegxp = /^[a-zA-Z]+$/i;
  return  myRegxp.test(string);
};

var manyValidators = [
    { validator: isNotTooShort, msg: 'Is too short' },
    { validator: onlyLettersAllow, msg: 'Only Letters' }
];

var userSchema = new Schema({ 
    name: { type: String, validate: manyValidators },
    email: {type: String, required : true, validate: validateEmail },
    createdOn: { type: Date, default: Date.now },
    lastLogin: { type: Date, default: Date.now }
});

```

another example :
You can add more than one validation in mongoose like `tags` and use mongoose default validation like the `name`:

```
const Course = mongoose.model('Course', mongoose.Schema({
  name: {
    minLength: 5,
    maxLength: 50,
    type: String,
    required: true,
  },
  tags: {
    type: Array,
    required: true,
    validate: [
      {
        validator: function (v) {
            return v && v.length > 0
          },
          message: 'tags is required ...'
        },
        {
          validator: function (v) {
            return v && v.length < 2
          },
          message: 'tags are too much ...'
      }
    ]
  },
  date: { 
    type: Date,
    default: Date.now
  }
}))

```