{"action":"closed","issue":{"url":"https://api.github.com/repos/sedouard/mongodb-mva/issues/4","labels_url":"https://api.github.com/repos/sedouard/mongodb-mva/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/sedouard/mongodb-mva/issues/4/comments","events_url":"https://api.github.com/repos/sedouard/mongodb-mva/issues/4/events","html_url":"https://github.com/sedouard/mongodb-mva/issues/4","id":56551715,"number":4,"title":"Wrong db query in Module 2","user":{"login":"ranjeet-floyd","id":1992972,"avatar_url":"https://avatars.githubusercontent.com/u/1992972?v=3","gravatar_id":"","url":"https://api.github.com/users/ranjeet-floyd","html_url":"https://github.com/ranjeet-floyd","followers_url":"https://api.github.com/users/ranjeet-floyd/followers","following_url":"https://api.github.com/users/ranjeet-floyd/following{/other_user}","gists_url":"https://api.github.com/users/ranjeet-floyd/gists{/gist_id}","starred_url":"https://api.github.com/users/ranjeet-floyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ranjeet-floyd/subscriptions","organizations_url":"https://api.github.com/users/ranjeet-floyd/orgs","repos_url":"https://api.github.com/users/ranjeet-floyd/repos","events_url":"https://api.github.com/users/ranjeet-floyd/events{/privacy}","received_events_url":"https://api.github.com/users/ranjeet-floyd/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-04T16:39:26Z","updated_at":"2015-02-04T17:22:28Z","closed_at":"2015-02-04T17:22:28Z","body":"Given .. \r\ndb.bank_data.find({ accounts: { $elemMatch : { \"account_type\": {$ne: \"Checking\"}, \"currency\": \"USD\", 'account_balance' : { $gt: 9900000 } } } } ).sort({ accounts.account_balance: -1 })\r\n\r\ndb.bank_data.find({ 'accounts.account_balance': {$gt: 9000000}, 'account.currency': 'USD' })\r\n\r\nshould be.....\r\n  \r\ndb.bank_data.find({ 'accounts.account_balance': {$gt: 9000000}, 'accounts.currency': 'USD' })\r\n\r\ndb.bank_data.find({ accounts: { $elemMatch : { \"account_type\": {$ne: \"Checking\"}, \"currency\": \"USD\", 'account_balance' : { $gt: 9900000 } } } } ).sort({ \"accounts.account_balance\": -1 })\r\n\r\n"}}