Structure of Document:
Mongoose Schema:
var mongoSchema = new Schema({
name: String,
description: String,
location: { lat: Number, long: Number },
images: [String],
blocks: { text: String, logo: String },
subLocations: {
name: String,
description: String,
location: {
lat: Number,
long: Number
},
images: [String]
}
});
Following Query does not work:
mongooseModel.find().
where('location.lat').equals(18.710145).
exec(function(err, response) {
}
While this query does work:
mongooseModel.find().
where('lat').equals("18.710145").
exec(function(err, response) {
}
Any guidance?