not sure MongoDB Atlas is different for on prem MongoDB! Can you explain what you are trying to do?
– Book Of ZeusNov 28 '19 at 06:05
@BookOfZeus I want to search for stores within 1 km of the user, and can search for store names, sorted by store name or distance.
– David DevNov 28 '19 at 06:15
You should be able to perform the same operations as long you have access and the same data. I recently migrated to MongoDB Atlas and we didn't have any issues running the same actions/queries. If you currently running these queries, try a development instance (it's free i think) import your data and try, you will see right away
– Book Of ZeusNov 28 '19 at 06:34
@BookOfZeus My sql like this: db.getCollection('campfire').aggregate([{"$searchBeta":{"search":{"query":["msg"],"path":["title"],"phrase":{"prefix":true}}}},{"$match":{"title":"msg01"}},{"$skip":0},{"$limit":10}]), but query timeout. You can get result like this?
– David DevNov 28 '19 at 06:53
@BookOfZeus By the way, i insert 1.5 million test data. This problem was not found when the amount of data was small.
– David DevNov 28 '19 at 06:56
Query time out means you probably does not use proper index, make sure your indexes looks good. Run an explain() on it to see whats going on: `db.campfire.explain()`
– Book Of ZeusNov 29 '19 at 17:35
1 Answers1
1
The $search (or $searchBeta) stage now supports geospatial queries.
Your field that contains geospatial data must be mapped to geo type. Then there are a few possible ways to query that data: near, geoWithin and geoShape.