mongodb / stitch-android-sdk

MongoDB Stitch Android SDK
Apache License 2.0
58 stars 33 forks source link

Example project stopped working #12

Closed szaske closed 6 years ago

szaske commented 7 years ago

I had the PlateSpace app working on my dev machine, but yesterday it stopped working and is giving me a "com.mongodb.stitch.android.StitchException$StitchServiceException: aggregation stage "$geoNear" is not supported" error. I also noticed that the online documentation says to use: compile 'org.mongodb:stitch:1.0.0-SNAPSHOT' and that has caused a bunch of issues in my code on another project. Can someone explain what's going on?

edaniels commented 7 years ago

Hey Steve! So this is will be an embarrassing response. We never intended for $geoNear to be supported but it made it into the PlateSpace example. This week we released an update that strictly forbids $geoNear (for technical reasons) and recommend that you use $geoWithin inside a $match with a sphere centered at a point (possibly doing a $sort as well). We will be addressing the issue with the PlateSpace app. We failed to realize the app was using the $geoNear before performing the release so apologies on our end. Let me know if you have any other questions.

szaske commented 7 years ago

Thanks Eric for the quick response, I'll take a look at $geoWithin. On a related note, with the update we lost the auth.getProvider() method. I've tried looking through your source code and cannot find a replacement. Can you explain how we can get the provider name now? I still learning Mongo and coding. I saw your AuthInfo class, but cannot figure out how to instantiate one.

jsflax commented 7 years ago

Hi Steve! The latest update for the Stitch Android SDK was a major version upgrade, so there have been breaking changes.

As far as auth.getProvider(), this was deprecated code that due for removal, and AuthInfo has become appropriately internalized so it cannot be accessed. If you could help me understand your flow (by posting your code or otherwise), it could help me offer you some alternatives for getting you provider name.

szaske commented 7 years ago

Is there a way to get GeoWithin to return a distance? Or if you could should me the JSON expression with a MATCH/GeoWithin/SORT that would be very helpful. I've been using the Switch Debug console to test various pipelines, and it's very helpful.

edaniels commented 6 years ago

I don't think there is a way to compute the distance reasonably. Sorry @szaske