{"action":"opened","issue":{"url":"https://api.github.com/repos/codedmart/catbox-rethinkdb/issues/3","labels_url":"https://api.github.com/repos/codedmart/catbox-rethinkdb/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/codedmart/catbox-rethinkdb/issues/3/comments","events_url":"https://api.github.com/repos/codedmart/catbox-rethinkdb/issues/3/events","html_url":"https://github.com/codedmart/catbox-rethinkdb/issues/3","id":107526491,"number":3,"title":"Expired row deletion query should use .between instead of filter","user":{"login":"deontologician","id":1366,"avatar_url":"https://avatars.githubusercontent.com/u/1366?v=3","gravatar_id":"","url":"https://api.github.com/users/deontologician","html_url":"https://github.com/deontologician","followers_url":"https://api.github.com/users/deontologician/followers","following_url":"https://api.github.com/users/deontologician/following{/other_user}","gists_url":"https://api.github.com/users/deontologician/gists{/gist_id}","starred_url":"https://api.github.com/users/deontologician/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deontologician/subscriptions","organizations_url":"https://api.github.com/users/deontologician/orgs","repos_url":"https://api.github.com/users/deontologician/repos","events_url":"https://api.github.com/users/deontologician/events{/privacy}","received_events_url":"https://api.github.com/users/deontologician/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-21T14:35:38Z","updated_at":"2015-09-21T14:35:38Z","closed_at":null,"body":"Right now it isn't using the 'expiresAt' index since it's using a filter (which can't take advantage of indexes)\r\n\r\nthis line:https://github.com/codedmart/catbox-rethinkdb/blob/master/lib/index.js#L39\r\n\r\nshould become something like:\r\n\r\n```js\r\nthis.table\r\n    .between(RethinkDB.minval(), RethinkDB.now(), {index: 'expiresAt'})\r\n    .delete()\r\n    .run(this.client);\r\n```"}}