I would need to have something like this
{
event : "something",
location : [
{
long:25, lat:34
}.
}
long:25, lat:35
}.
.
.
.
]
}
Is this possible? And is it possible to have a geospatial index for the location field? I would have queries with $nearSphere.
Thanks
EDIT: mongoose schema question
having the schema entry be something like location : [{ lon : Number, lat: Number}] gets me to end up with an aditional _id for each object in the location array. Is that 1. a problem? 2. a nuissance? 3. something that i can fix?
ex : { "lon":1, "lat":2, "_id":"50bfeea2a3092d1d67000007" },
,
instead of.
between thelocation
array elements :). but seriously, why wouldn't work, have you tried? Check Geospatial Indexing in the manual, it sounds me exactly what you want. – balazs