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

find with nearSphere #297

Closed ylhermitte closed 2 years ago

ylhermitte commented 2 years ago

Hello, I try to use nearSphere in find request but i have the messages "Undefined class 'Geometry'" and "The method 'Geometry' isn't defined for the type 'MongoDatabase'".

If i add import 'package:mongo_dart_query/src/geometry_obj.dart'; it's ok. The class is found but i have the warning message "Don't import implementation files from another package."

Is there a solution?

giorgiofran commented 2 years ago

Add mongo_dart_query to your pubspec.yaml file

ylhermitte commented 2 years ago

Thank you for your answer but it doesn't change anything

Here is my pubspec.yaml dependencies: flutter: sdk: flutter mongo_dart: ^0.7.4+1 mongo_dart_query: ^1.0.0

Le 12 sept. 2022 à 11:33, Giorgio @.***> a écrit :

 Add mongo_dart_query to your pubspec.yaml file

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

giorgiofran commented 2 years ago

There is a wrong definition in the mongo_dart_query package: the Geometry class should be public and exported in a class below the lib folder. This is something to be fixed in the package that I will do. You can temporarily do the following:

// ignore: implementation_imports
import 'package:mongo_dart_query/src/geometry_obj.dart';
ylhermitte commented 2 years ago

Thank you very much for your feedback