{"action":"created","issue":{"url":"https://api.github.com/repos/mongo-dart/mongo_dart/issues/109","repository_url":"https://api.github.com/repos/mongo-dart/mongo_dart","labels_url":"https://api.github.com/repos/mongo-dart/mongo_dart/issues/109/labels{/name}","comments_url":"https://api.github.com/repos/mongo-dart/mongo_dart/issues/109/comments","events_url":"https://api.github.com/repos/mongo-dart/mongo_dart/issues/109/events","html_url":"https://github.com/mongo-dart/mongo_dart/issues/109","id":241266344,"number":109,"title":"Lookup by BsonBinary not working","user":{"login":"sanmadjack","id":1385789,"avatar_url":"https://avatars1.githubusercontent.com/u/1385789?v=3","gravatar_id":"","url":"https://api.github.com/users/sanmadjack","html_url":"https://github.com/sanmadjack","followers_url":"https://api.github.com/users/sanmadjack/followers","following_url":"https://api.github.com/users/sanmadjack/following{/other_user}","gists_url":"https://api.github.com/users/sanmadjack/gists{/gist_id}","starred_url":"https://api.github.com/users/sanmadjack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanmadjack/subscriptions","organizations_url":"https://api.github.com/users/sanmadjack/orgs","repos_url":"https://api.github.com/users/sanmadjack/repos","events_url":"https://api.github.com/users/sanmadjack/events{/privacy}","received_events_url":"https://api.github.com/users/sanmadjack/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-07-07T13:37:43Z","updated_at":"2017-07-07T13:50:17Z","closed_at":null,"body":"I'm querying using this selector:\r\n\r\n`where.eq(idField, new BsonBinary.fromHexString(id)\r\n`\r\n\r\nAnd getting this error:\r\n\r\n```\r\nNoSuchMethodError: The getter 'length' was called on null.\r\nTried calling: length\r\n#0      Object._noSuchMethod (dart:core-patch/object_patch.dart:43)\r\n#1      Object.noSuchMethod (dart:core-patch/object_patch.dart:47)\r\n#2      BsonBinary.byteLength (package:bson/src/types/binary.dart:208:32)\r\n#3      elementSize (package:bson/src/bson_type.dart:95:33)\r\n#4      BsonMap.dataSize.<anonymous closure> (package:bson/src/types/map.dart:11:25)\r\n#5      _HashVMBase&MapMixin&&_LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:356)\r\n#6      BsonMap.dataSize (package:bson/src/types/map.dart:9:12)\r\n#7      BsonMap.byteLength (package:bson/src/types/map.dart:18:17)\r\n#8      elementSize (package:bson/src/bson_type.dart:95:33)\r\n#9      BsonMap.dataSize.<anonymous closure> (package:bson/src/types/map.dart:11:25)\r\n#10     _HashVMBase&MapMixin&&_LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:356)\r\n#11     BsonMap.dataSize (package:bson/src/types/map.dart:9:12)\r\n#12     BsonMap.byteLength (package:bson/src/types/map.dart:18:17)\r\n#13     MongoQueryMessage.messageLength (package:mongo_dart/src/database/mongo_query_message.dart:36:67)\r\n#14     MongoQueryMessage.serialize (package:mongo_dart/src/database/mongo_query_message.dart:44:40)\r\n#15     _Connection._sendBuffer (package:mongo_dart/src/network/connection.dart:86:35)\r\n#16     _Connection.query (package:mongo_dart/src/network/connection.dart:98:7)\r\n#17     Db.executeDbCommand (package:mongo_dart/src/database/db.dart:263:41)\r\n<asynchronous suspension>\r\n#18     DbCollection.count (package:mongo_dart/src/database/dbcollection.dart:93:15)\r\n\r\n```\r\nAm I doing it wrong?"},"comment":{"url":"https://api.github.com/repos/mongo-dart/mongo_dart/issues/comments/313685956","html_url":"https://github.com/mongo-dart/mongo_dart/issues/109#issuecomment-313685956","issue_url":"https://api.github.com/repos/mongo-dart/mongo_dart/issues/109","id":313685956,"user":{"login":"vadimtsushko","id":1159274,"avatar_url":"https://avatars3.githubusercontent.com/u/1159274?v=3","gravatar_id":"","url":"https://api.github.com/users/vadimtsushko","html_url":"https://github.com/vadimtsushko","followers_url":"https://api.github.com/users/vadimtsushko/followers","following_url":"https://api.github.com/users/vadimtsushko/following{/other_user}","gists_url":"https://api.github.com/users/vadimtsushko/gists{/gist_id}","starred_url":"https://api.github.com/users/vadimtsushko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vadimtsushko/subscriptions","organizations_url":"https://api.github.com/users/vadimtsushko/orgs","repos_url":"https://api.github.com/users/vadimtsushko/repos","events_url":"https://api.github.com/users/vadimtsushko/events{/privacy}","received_events_url":"https://api.github.com/users/vadimtsushko/received_events","type":"User","site_admin":false},"created_at":"2017-07-07T13:50:17Z","updated_at":"2017-07-07T13:50:17Z","body":"If your id field is of type https://docs.mongodb.com/manual/reference/method/ObjectId/ it probably shoud be something like  \r\n\r\n```where.eq(idField, new ObjectId.fromHexString(id))```\r\n\r\nor \r\n\r\n```where.id(new ObjectId.fromHexString(id))```\r\n\r\nif  idField is `_id`\r\n"}}
{"actor":{"display_login":"vadimtsushko"}}