Geospatial Queries for Line Intersection

Hi, I’m in the process of determining whether I should use MongoDB or Postgres (or something else) for an app that will be making pretty intensive geospatial queries.

More specifically, they will involve determining the paths (a MultiLineString?) a coordinate point would be close to, and based on a matching timestamp.

The vice versa would also need to happen. Given a path of coordinates, I would need to query which coordinate points this path got close to.

Could MongoDB be the right tool for the job? Is MongoDB able to support this out of the box or with a relatively idiomatic query construction? This post seems to suggest using $centerSphere with $geoWithin would work despite the docs saying

Selects documents with geospatial data that exists entirely within a specified shape.

Even if so and works with a multi-point path, can the query still work in vice versa where
the points are queried given a path? Thanks!