{"action":"created","comment":{"url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/pulls/comments/85674818","pull_request_review_id":6376868,"id":85674818,"diff_hunk":"@@ -0,0 +1,104 @@\n+var _ = require('underscore');\n+var config = require('./config');\n+var bsonUrlEncoding = require('./utils/bsonUrlEncoding');\n+\n+/**\n+ * Performs a search query on a Mongo collection and pages the results. This is different from\n+ * find() in that the results are ordered by their relevancy, and as such, it does not take\n+ * a paginatedField parameter. Note that this is less performant than find() because it must\n+ * perform the full search on each call to this function. Also note that results might change\n+ *\n+ * @param {MongoCollection} collection A collection object returned from the MongoDB library's\n+ *    `db.collection(<collectionName>)` method. This MUST have a Mongo $text index on it.\n+ *    See https://docs.mongodb.com/manual/core/index-text/.\n+ * @param {String} searchString String to search on.\n+ * @param {Object} params\n+ *    -query {Object} The find query.\n+ *    -limit {Number} The page size. Must be between 1 and `config.MAX_LIMIT`.\n+ *    -fields {Object} Fields to query in the Mongo object format, e.g. {title :1}.\n+ *      The default is to query ONLY _id (note this is a difference from `find()`).\n+ *    -next {String} The value to start querying the page. Defaults to start at the beginning of\n+ *      the results.","path":"src/search.js","position":21,"original_position":21,"commit_id":"49add66ec9745fd4d470fa8c00403401301e6eea","original_commit_id":"49add66ec9745fd4d470fa8c00403401301e6eea","user":{"login":"bradvogel","id":821706,"avatar_url":"https://avatars.githubusercontent.com/u/821706?v=3","gravatar_id":"","url":"https://api.github.com/users/bradvogel","html_url":"https://github.com/bradvogel","followers_url":"https://api.github.com/users/bradvogel/followers","following_url":"https://api.github.com/users/bradvogel/following{/other_user}","gists_url":"https://api.github.com/users/bradvogel/gists{/gist_id}","starred_url":"https://api.github.com/users/bradvogel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradvogel/subscriptions","organizations_url":"https://api.github.com/users/bradvogel/orgs","repos_url":"https://api.github.com/users/bradvogel/repos","events_url":"https://api.github.com/users/bradvogel/events{/privacy}","received_events_url":"https://api.github.com/users/bradvogel/received_events","type":"User","site_admin":false},"body":"Nah, added that to 'future' since it's a bit tricky to implement with the aggregation.","created_at":"2016-10-31T00:50:20Z","updated_at":"2016-10-31T00:50:20Z","html_url":"https://github.com/mixmaxhq/mongo-cursor-pagination/pull/3#discussion_r85674818","pull_request_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/pulls/comments/85674818"},"html":{"href":"https://github.com/mixmaxhq/mongo-cursor-pagination/pull/3#discussion_r85674818"},"pull_request":{"href":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/pulls/3","id":91537707,"html_url":"https://github.com/mixmaxhq/mongo-cursor-pagination/pull/3","diff_url":"https://github.com/mixmaxhq/mongo-cursor-pagination/pull/3.diff","patch_url":"https://github.com/mixmaxhq/mongo-cursor-pagination/pull/3.patch","issue_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/issues/3","number":3,"state":"closed","locked":false,"title":"Brad/add search","user":{"login":"bradvogel","id":821706,"avatar_url":"https://avatars.githubusercontent.com/u/821706?v=3","gravatar_id":"","url":"https://api.github.com/users/bradvogel","html_url":"https://github.com/bradvogel","followers_url":"https://api.github.com/users/bradvogel/followers","following_url":"https://api.github.com/users/bradvogel/following{/other_user}","gists_url":"https://api.github.com/users/bradvogel/gists{/gist_id}","starred_url":"https://api.github.com/users/bradvogel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradvogel/subscriptions","organizations_url":"https://api.github.com/users/bradvogel/orgs","repos_url":"https://api.github.com/users/bradvogel/repos","events_url":"https://api.github.com/users/bradvogel/events{/privacy}","received_events_url":"https://api.github.com/users/bradvogel/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-30T21:43:22Z","updated_at":"2016-10-31T00:50:20Z","closed_at":"2016-10-30T21:44:03Z","merged_at":"2016-10-30T21:44:03Z","merge_commit_sha":"9155df0d3b36bb1236f86275fffb79e5d0cdffb1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/pulls/3/commits","review_comments_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/pulls/3/comments","review_comment_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/issues/3/comments","statuses_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/statuses/49add66ec9745fd4d470fa8c00403401301e6eea","head":{"label":"mixmaxhq:brad/add-search","ref":"brad/add-search","sha":"49add66ec9745fd4d470fa8c00403401301e6eea","user":{"login":"mixmaxhq","id":7530142,"avatar_url":"https://avatars.githubusercontent.com/u/7530142?v=3","gravatar_id":"","url":"https://api.github.com/users/mixmaxhq","html_url":"https://github.com/mixmaxhq","followers_url":"https://api.github.com/users/mixmaxhq/followers","following_url":"https://api.github.com/users/mixmaxhq/following{/other_user}","gists_url":"https://api.github.com/users/mixmaxhq/gists{/gist_id}","starred_url":"https://api.github.com/users/mixmaxhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mixmaxhq/subscriptions","organizations_url":"https://api.github.com/users/mixmaxhq/orgs","repos_url":"https://api.github.com/users/mixmaxhq/repos","events_url":"https://api.github.com/users/mixmaxhq/events{/privacy}","received_events_url":"https://api.github.com/users/mixmaxhq/received_events","type":"Organization","site_admin":false},"repo":{"id":71541924,"name":"mongo-cursor-pagination","full_name":"mixmaxhq/mongo-cursor-pagination","owner":{"login":"mixmaxhq","id":7530142,"avatar_url":"https://avatars.githubusercontent.com/u/7530142?v=3","gravatar_id":"","url":"https://api.github.com/users/mixmaxhq","html_url":"https://github.com/mixmaxhq","followers_url":"https://api.github.com/users/mixmaxhq/followers","following_url":"https://api.github.com/users/mixmaxhq/following{/other_user}","gists_url":"https://api.github.com/users/mixmaxhq/gists{/gist_id}","starred_url":"https://api.github.com/users/mixmaxhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mixmaxhq/subscriptions","organizations_url":"https://api.github.com/users/mixmaxhq/orgs","repos_url":"https://api.github.com/users/mixmaxhq/repos","events_url":"https://api.github.com/users/mixmaxhq/events{/privacy}","received_events_url":"https://api.github.com/users/mixmaxhq/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mixmaxhq/mongo-cursor-pagination","description":"Cursor-based pagination for Mongo","fork":false,"url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination","forks_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/forks","keys_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/teams","hooks_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/hooks","issue_events_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/issues/events{/number}","events_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/events","assignees_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/assignees{/user}","branches_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/branches{/branch}","tags_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/tags","blobs_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/git/refs{/sha}","trees_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/statuses/{sha}","languages_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/languages","stargazers_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/stargazers","contributors_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/contributors","subscribers_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/subscribers","subscription_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/subscription","commits_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/commits{/sha}","git_commits_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/git/commits{/sha}","comments_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/comments{/number}","issue_comment_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/issues/comments{/number}","contents_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/contents/{+path}","compare_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/merges","archive_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/downloads","issues_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/issues{/number}","pulls_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/pulls{/number}","milestones_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/milestones{/number}","notifications_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/labels{/name}","releases_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/releases{/id}","deployments_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/deployments","created_at":"2016-10-21T07:41:57Z","updated_at":"2016-10-26T02:36:03Z","pushed_at":"2016-10-30T21:44:51Z","git_url":"git://github.com/mixmaxhq/mongo-cursor-pagination.git","ssh_url":"git@github.com:mixmaxhq/mongo-cursor-pagination.git","clone_url":"https://github.com/mixmaxhq/mongo-cursor-pagination.git","svn_url":"https://github.com/mixmaxhq/mongo-cursor-pagination","homepage":null,"size":31,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"mixmaxhq:master","ref":"master","sha":"b79ef4ce18f27ed745c6f0463b1a6b96e2380ec8","user":{"login":"mixmaxhq","id":7530142,"avatar_url":"https://avatars.githubusercontent.com/u/7530142?v=3","gravatar_id":"","url":"https://api.github.com/users/mixmaxhq","html_url":"https://github.com/mixmaxhq","followers_url":"https://api.github.com/users/mixmaxhq/followers","following_url":"https://api.github.com/users/mixmaxhq/following{/other_user}","gists_url":"https://api.github.com/users/mixmaxhq/gists{/gist_id}","starred_url":"https://api.github.com/users/mixmaxhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mixmaxhq/subscriptions","organizations_url":"https://api.github.com/users/mixmaxhq/orgs","repos_url":"https://api.github.com/users/mixmaxhq/repos","events_url":"https://api.github.com/users/mixmaxhq/events{/privacy}","received_events_url":"https://api.github.com/users/mixmaxhq/received_events","type":"Organization","site_admin":false},"repo":{"id":71541924,"name":"mongo-cursor-pagination","full_name":"mixmaxhq/mongo-cursor-pagination","owner":{"login":"mixmaxhq","id":7530142,"avatar_url":"https://avatars.githubusercontent.com/u/7530142?v=3","gravatar_id":"","url":"https://api.github.com/users/mixmaxhq","html_url":"https://github.com/mixmaxhq","followers_url":"https://api.github.com/users/mixmaxhq/followers","following_url":"https://api.github.com/users/mixmaxhq/following{/other_user}","gists_url":"https://api.github.com/users/mixmaxhq/gists{/gist_id}","starred_url":"https://api.github.com/users/mixmaxhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mixmaxhq/subscriptions","organizations_url":"https://api.github.com/users/mixmaxhq/orgs","repos_url":"https://api.github.com/users/mixmaxhq/repos","events_url":"https://api.github.com/users/mixmaxhq/events{/privacy}","received_events_url":"https://api.github.com/users/mixmaxhq/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mixmaxhq/mongo-cursor-pagination","description":"Cursor-based pagination for Mongo","fork":false,"url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination","forks_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/forks","keys_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/teams","hooks_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/hooks","issue_events_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/issues/events{/number}","events_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/events","assignees_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/assignees{/user}","branches_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/branches{/branch}","tags_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/tags","blobs_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/git/refs{/sha}","trees_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/statuses/{sha}","languages_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/languages","stargazers_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/stargazers","contributors_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/contributors","subscribers_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/subscribers","subscription_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/subscription","commits_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/commits{/sha}","git_commits_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/git/commits{/sha}","comments_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/comments{/number}","issue_comment_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/issues/comments{/number}","contents_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/contents/{+path}","compare_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/merges","archive_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/downloads","issues_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/issues{/number}","pulls_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/pulls{/number}","milestones_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/milestones{/number}","notifications_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/labels{/name}","releases_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/releases{/id}","deployments_url":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/deployments","created_at":"2016-10-21T07:41:57Z","updated_at":"2016-10-26T02:36:03Z","pushed_at":"2016-10-30T21:44:51Z","git_url":"git://github.com/mixmaxhq/mongo-cursor-pagination.git","ssh_url":"git@github.com:mixmaxhq/mongo-cursor-pagination.git","clone_url":"https://github.com/mixmaxhq/mongo-cursor-pagination.git","svn_url":"https://github.com/mixmaxhq/mongo-cursor-pagination","homepage":null,"size":31,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/pulls/3"},"html":{"href":"https://github.com/mixmaxhq/mongo-cursor-pagination/pull/3"},"issue":{"href":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/issues/3"},"comments":{"href":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/mixmaxhq/mongo-cursor-pagination/statuses/49add66ec9745fd4d470fa8c00403401301e6eea"}}}}
{"actor":{"display_login":"bradvogel"}}