mongo-dart / mongo_dart

Mongo_dart: MongoDB driver for Dart programming language
https://pub.dev/packages/mongo_dart
MIT License
446 stars 98 forks source link

`geoNear` and `$vectorSearch` not yet supported #354

Open lukehutch opened 9 months ago

lukehutch commented 9 months ago

I need to be able to query geo points using $geoNear (with a 2dsphere index), and vector data using $vectorSearch. These don't seem to be supported yet in mongo_dart. Is there a way to perform these search types manually, or would support for these have to be added to mongo_dart?

$geoNear:

$vectorSearch:

giorgiofran commented 9 months ago

Hi $geoNear is supported (GeoNear class), vector search it is not. I have also found a slightly different syntax with respect tot the amazon one: https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-stage/ Atlas specific stages and operator will not be managed in mongo_dart_query. I will provide these operators and stages in the newcoming mongo_db_query, that aims to substite the former. But still it will take some time to be ready.

lukehutch commented 9 months ago

Correct, the DocumentDB and MomgoDB syntaxes are slightly different... Maybe Amazon added vector search first, then Mongo went with a different syntax. I would assume the syntax will converge over time?

giorgiofran commented 9 months ago

I really don't know ...

giorgiofran commented 4 months ago

Hi, I have released in alpha version a new package for helping the creation of the query and update documents. The name of the package ismongo_db_query. I have also published a development version of a new driver mongo_db_driver that has support for transactions. If you have time to test it would be a great help!

lukehutch commented 4 months ago

@giorgiofran thanks, this is super awesome, and thanks for letting me know. However, I pivoted away from using Mongodb because I switched to using Serverpod for the backend, and Serverpod uses Postgres for its ORM.