You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, I have this mongoose model: {coordinateX: SchemaTypes.Double, coordinateY: SchemaTypes.Double}
and I'm trying to parse using the geojson tool, like this model.find({},function(err,stuff) { var geo = geojson.parse(stuff, { Point: ['coordinateX','coordinateY'] include: ['address'] });
However, somehow, when I'm going to test, it gives me something like this: type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": {}, "properties": { "address": "It can read this" } }, { "type": "Feature", "geometry": {}, "properties": { "address": "Rua Arco do Chafariz das Terras 3" } },
What am I doing wrong? is it because the coordinates types are wrong?
Activity
andressoop commentedon Jul 19, 2019
3 years late, but I ran into similar issue.
If anyone else is looking for a solution to this, then you have to strip the returned mongoose doc first with .lean()
like this:
Model.find().lean().exec.().then( docs => { } );