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 brings some fields #337

Closed paulobreim closed 1 year ago

paulobreim commented 1 year ago

How do I do a find and bring only a few fields. I tried for example:

await mycoll.find({name: 1,email:1}).toList(); or like mongosh await mycoll.find({},{email:1}) but dos not works

the fields parameter no longer exists

tks

giorgiofran commented 1 year ago

https://github.com/mongo-dart/mongo_dart#find

paulobreim commented 1 year ago

Thank you, i made it and works

var result = await collection.find(where.fields(['field1'])).toList();

giorgiofran commented 1 year ago

De Nada