I have a Mongoose Schema like this:
var userSchema = new mongoose.Schema({
name: String,
email: String,
data: [String],
});
And using Mongoose search I want to compare some value with the first element of data, im trying something like:
users.FindOne({data[0]: value}, {}, function(err, resp){
//code
});
That of course doesen't work, how can I compare a value with the n element of an array?.
Thanks in advance.