{"action":"created","issue":{"url":"https://api.github.com/repos/techfort/LokiJS/issues/483","repository_url":"https://api.github.com/repos/techfort/LokiJS","labels_url":"https://api.github.com/repos/techfort/LokiJS/issues/483/labels{/name}","comments_url":"https://api.github.com/repos/techfort/LokiJS/issues/483/comments","events_url":"https://api.github.com/repos/techfort/LokiJS/issues/483/events","html_url":"https://github.com/techfort/LokiJS/issues/483","id":180489140,"number":483,"title":"$and operator / find with multiple fields broken","user":{"login":"fimad","id":409115,"avatar_url":"https://avatars.githubusercontent.com/u/409115?v=3","gravatar_id":"","url":"https://api.github.com/users/fimad","html_url":"https://github.com/fimad","followers_url":"https://api.github.com/users/fimad/followers","following_url":"https://api.github.com/users/fimad/following{/other_user}","gists_url":"https://api.github.com/users/fimad/gists{/gist_id}","starred_url":"https://api.github.com/users/fimad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fimad/subscriptions","organizations_url":"https://api.github.com/users/fimad/orgs","repos_url":"https://api.github.com/users/fimad/repos","events_url":"https://api.github.com/users/fimad/events{/privacy}","received_events_url":"https://api.github.com/users/fimad/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-02T01:13:48Z","updated_at":"2016-10-02T01:15:43Z","closed_at":"2016-10-02T01:15:43Z","body":"For example, paste the following into the [online sandbox](https://rawgit.com/techfort/LokiJS/master/examples/sandbox/LokiSandbox.htm).\r\n\r\n```js\r\nvar db = new loki('sandbox.db');\r\nvar items = db.addCollection('items');\r\nitems.insert({ foo : '1', bar: '1'});\r\nitems.insert({ foo : '2', bar: '2'});\r\nlogObject(items.findOne({foo: '1', bar: '2'}));\r\nlogObject(items.findOne({'$and': [{foo: '1', bar: '2'}]}));\r\n```\r\n\r\nI would expect the output to be:\r\n\r\n```json\r\nnull\r\nnull\r\n```\r\n\r\nHowever, the output I get instead is:\r\n\r\n```json\r\n{\r\n  \"foo\": \"1\",\r\n  \"bar\": \"1\",\r\n  \"meta\": {\r\n    \"revision\": 0,\r\n    \"created\": 1475370378188,\r\n    \"version\": 0\r\n  },\r\n  \"$loki\": 1\r\n}\r\n{\r\n  \"foo\": \"1\",\r\n  \"bar\": \"1\",\r\n  \"meta\": {\r\n    \"revision\": 0,\r\n    \"created\": 1475370378188,\r\n    \"version\": 0\r\n  },\r\n  \"$loki\": 1\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/techfort/LokiJS/issues/comments/250947636","html_url":"https://github.com/techfort/LokiJS/issues/483#issuecomment-250947636","issue_url":"https://api.github.com/repos/techfort/LokiJS/issues/483","id":250947636,"user":{"login":"fimad","id":409115,"avatar_url":"https://avatars.githubusercontent.com/u/409115?v=3","gravatar_id":"","url":"https://api.github.com/users/fimad","html_url":"https://github.com/fimad","followers_url":"https://api.github.com/users/fimad/followers","following_url":"https://api.github.com/users/fimad/following{/other_user}","gists_url":"https://api.github.com/users/fimad/gists{/gist_id}","starred_url":"https://api.github.com/users/fimad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fimad/subscriptions","organizations_url":"https://api.github.com/users/fimad/orgs","repos_url":"https://api.github.com/users/fimad/repos","events_url":"https://api.github.com/users/fimad/events{/privacy}","received_events_url":"https://api.github.com/users/fimad/received_events","type":"User","site_admin":false},"created_at":"2016-10-02T01:15:43Z","updated_at":"2016-10-02T01:15:43Z","body":"I just tried\r\n\r\n```js\r\nlogObject(items.findOne({'$and': [{foo: '1'}, {bar: '2'}]}));\r\n```\r\n\r\nwhich does appear to work, so maybe this is just a misinterpretation on my part."}}
{"actor":{"display_login":"fimad"}}