find method
Creates a cursor for a query that can be used to iterate over results
from MongoDB
##selector
parameter represents query to locate objects. If omitted as in find()
then query matches all documents in colleciton.
Here's a more selective example:
find({'last_name': 'Smith'})
Here our selector will match every document where the last_name attribute
is 'Smith.'
Implementation
Stream<Map<String, dynamic>> find([selector]) {
if (db._masterConnectionVerified.serverCapabilities.supportsOpMsg) {
if (selector is SelectorBuilder) {
return modernFind(selector: selector);
} else if (selector is Map<String, dynamic>) {
return modernFind(filter: selector);
} else if (selector == null) {
return modernFind();
}
throw MongoDartError('The selector parameter should be either a '
'SelectorBuilder or a Map<String, dynamic>');
}
return legacyFind(selector);
}