-
Notifications
You must be signed in to change notification settings - Fork 137
GeoJSON Support #45
Comments
Hello. This could happen because of two reasons:
Either way research must be made about geoJSON index (can it be defined in the schema property when using pure Mongoose). If it is possible then the bug must be eliminated in Typegoose. Both researching and PRs are greatly appreciated, if you have the time. Otherwise when I'll have the time will look into it. |
currently in the tests is typegoose/test/models/rating.ts Line 8 in ea1c0ec
and typegoose/test/models/rating.ts Lines 19 to 20 in ea1c0ec
i dont know if this "fixes" the full issue here... |
@hasezoey honestly it works just fine for the queries OP specified. defining class like in the example you brought
and doing query search with $nearSphere. |
i think this can now be closed as "solved" |
Hi,
is it possible to use GeoJSON with Typegoose?
I'm not able to create an index so I can search it with $nearSphere.
What I've tried is to create the following model to store the data:
In my user model I have added the following attribute:
Since there must be an index on currentLocation to be able to perform the $nearSphere query I tried
@prop({index: true})
.But I got the following error message:
Some tutorials said you must define your own type to store the location data.
But how do I do it with Typegoose?
The mongoose way is:
What do I need to do to solve this issue?
The text was updated successfully, but these errors were encountered: