i have a mongoose schema like this :
var LogsSchema = new Schema({
date: Date,
longitude: String,
latitude: String,
speed: Number
});
var DeviceSchema = new Schema({
name: String,
model: String,
phone: {
type: Number,
required: true,
unique: true
},
push: Number,
logs: [LogsSchema],
})
i have huge array of logs in my database how can i sort limit and skip logs array data ?? currently i am taking only last 10 elements of array but i want to select applying condition . Using $elemMatch doesnot solve my problem it shows from whole collection but i need from individual documents. what is wish is to find logs from date range. Any suggestions are highly appreciated.