Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't parse Point #22

Open
fdacosta89 opened this issue May 6, 2016 · 1 comment
Open

Can't parse Point #22

fdacosta89 opened this issue May 6, 2016 · 1 comment

Comments

@fdacosta89
Copy link

Hi.

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?

Thank you!

@andressoop
Copy link

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 => { } );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants