{"action":"opened","number":4,"pull_request":{"url":"https://api.github.com/repos/aldeed/meteor-schema-index/pulls/4","id":59066171,"html_url":"https://github.com/aldeed/meteor-schema-index/pull/4","diff_url":"https://github.com/aldeed/meteor-schema-index/pull/4.diff","patch_url":"https://github.com/aldeed/meteor-schema-index/pull/4.patch","issue_url":"https://api.github.com/repos/aldeed/meteor-schema-index/issues/4","number":4,"state":"open","locked":false,"title":"Almost a complete rewrite.  Adds much more flexibility including supp…","user":{"login":"dpankros","id":7989367,"avatar_url":"https://avatars.githubusercontent.com/u/7989367?v=3","gravatar_id":"","url":"https://api.github.com/users/dpankros","html_url":"https://github.com/dpankros","followers_url":"https://api.github.com/users/dpankros/followers","following_url":"https://api.github.com/users/dpankros/following{/other_user}","gists_url":"https://api.github.com/users/dpankros/gists{/gist_id}","starred_url":"https://api.github.com/users/dpankros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpankros/subscriptions","organizations_url":"https://api.github.com/users/dpankros/orgs","repos_url":"https://api.github.com/users/dpankros/repos","events_url":"https://api.github.com/users/dpankros/events{/privacy}","received_events_url":"https://api.github.com/users/dpankros/received_events","type":"User","site_admin":false},"body":"This is almost a complete rewrite.  See the docs and you can readily discern what's different.  (Maybe I should add a migration section to the README?) \r\n\r\nIn short, this adds support for all mongo indexes and all their options, including compound indexes (thus, closing bugs #1 and #3).\r\n\r\nInstead of everything being in the schema, the column-specific options are there.  You just need to call `collection.attachIndex(name, options)` to actually create the index (assuming the schema is already attached).  Options are the full options to mongo.CreateIndex.  Further, if you call attachIndex before you call attachSchema, the index will be queued up until the schema is attached.  There is also a rebuild option to rebuild an index that has changed, rather than separately dropping and re-adding it.\r\n\r\nAll the tests work, with slight modifications to accommodate the syntax change in the schema and calling the new attachSchema method.  The only error I saw was on one test (around line 155) where it checks that \"invalidKeys.length\" is 1.  I wonder if this test was added when using a different mongo version because the error that is thrown by Mongo for me does not include an invalidKeys property. I see:\r\n```\r\n [MongoError: insertDocument :: caused by :: 11000 E11000 duplicate key error index: meteor.books.$isbnIdx  dup key: { : \"zYh74Qec3Wrk8tkBi\" }]\r\n   name: 'MongoError',\r\n   code: 11000,\r\n   err: 'insertDocument :: caused by :: 11000 E11000 duplicate key error index: meteor.books.$isbnIdx  dup key: { : \"zYh74Qec3Wrk8tkBi\" }' }\r\n```\r\nThe error looks like what the original test expected (minus the invalidKeys property) because it is purposely violating a unique index constraint.  So I added a test to check for code 11000 (the duplicate key error code) and commented out that one line in the original test.\r\n\r\nLove to get any comments.","created_at":"2016-02-11T17:35:43Z","updated_at":"2016-02-11T17:35:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3fa46149a265f5e89603bf3dcefefb4f534cb515","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/aldeed/meteor-schema-index/pulls/4/commits","review_comments_url":"https://api.github.com/repos/aldeed/meteor-schema-index/pulls/4/comments","review_comment_url":"https://api.github.com/repos/aldeed/meteor-schema-index/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aldeed/meteor-schema-index/issues/4/comments","statuses_url":"https://api.github.com/repos/aldeed/meteor-schema-index/statuses/b725c6ca31372a3c61eaa7ef4589a207878f4396","head":{"label":"dpankros:master","ref":"master","sha":"b725c6ca31372a3c61eaa7ef4589a207878f4396","user":{"login":"dpankros","id":7989367,"avatar_url":"https://avatars.githubusercontent.com/u/7989367?v=3","gravatar_id":"","url":"https://api.github.com/users/dpankros","html_url":"https://github.com/dpankros","followers_url":"https://api.github.com/users/dpankros/followers","following_url":"https://api.github.com/users/dpankros/following{/other_user}","gists_url":"https://api.github.com/users/dpankros/gists{/gist_id}","starred_url":"https://api.github.com/users/dpankros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpankros/subscriptions","organizations_url":"https://api.github.com/users/dpankros/orgs","repos_url":"https://api.github.com/users/dpankros/repos","events_url":"https://api.github.com/users/dpankros/events{/privacy}","received_events_url":"https://api.github.com/users/dpankros/received_events","type":"User","site_admin":false},"repo":{"id":51465211,"name":"meteor-schema-index","full_name":"dpankros/meteor-schema-index","owner":{"login":"dpankros","id":7989367,"avatar_url":"https://avatars.githubusercontent.com/u/7989367?v=3","gravatar_id":"","url":"https://api.github.com/users/dpankros","html_url":"https://github.com/dpankros","followers_url":"https://api.github.com/users/dpankros/followers","following_url":"https://api.github.com/users/dpankros/following{/other_user}","gists_url":"https://api.github.com/users/dpankros/gists{/gist_id}","starred_url":"https://api.github.com/users/dpankros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpankros/subscriptions","organizations_url":"https://api.github.com/users/dpankros/orgs","repos_url":"https://api.github.com/users/dpankros/repos","events_url":"https://api.github.com/users/dpankros/events{/privacy}","received_events_url":"https://api.github.com/users/dpankros/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dpankros/meteor-schema-index","description":"Control some MongoDB indexing with schema options","fork":true,"url":"https://api.github.com/repos/dpankros/meteor-schema-index","forks_url":"https://api.github.com/repos/dpankros/meteor-schema-index/forks","keys_url":"https://api.github.com/repos/dpankros/meteor-schema-index/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dpankros/meteor-schema-index/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dpankros/meteor-schema-index/teams","hooks_url":"https://api.github.com/repos/dpankros/meteor-schema-index/hooks","issue_events_url":"https://api.github.com/repos/dpankros/meteor-schema-index/issues/events{/number}","events_url":"https://api.github.com/repos/dpankros/meteor-schema-index/events","assignees_url":"https://api.github.com/repos/dpankros/meteor-schema-index/assignees{/user}","branches_url":"https://api.github.com/repos/dpankros/meteor-schema-index/branches{/branch}","tags_url":"https://api.github.com/repos/dpankros/meteor-schema-index/tags","blobs_url":"https://api.github.com/repos/dpankros/meteor-schema-index/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dpankros/meteor-schema-index/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dpankros/meteor-schema-index/git/refs{/sha}","trees_url":"https://api.github.com/repos/dpankros/meteor-schema-index/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dpankros/meteor-schema-index/statuses/{sha}","languages_url":"https://api.github.com/repos/dpankros/meteor-schema-index/languages","stargazers_url":"https://api.github.com/repos/dpankros/meteor-schema-index/stargazers","contributors_url":"https://api.github.com/repos/dpankros/meteor-schema-index/contributors","subscribers_url":"https://api.github.com/repos/dpankros/meteor-schema-index/subscribers","subscription_url":"https://api.github.com/repos/dpankros/meteor-schema-index/subscription","commits_url":"https://api.github.com/repos/dpankros/meteor-schema-index/commits{/sha}","git_commits_url":"https://api.github.com/repos/dpankros/meteor-schema-index/git/commits{/sha}","comments_url":"https://api.github.com/repos/dpankros/meteor-schema-index/comments{/number}","issue_comment_url":"https://api.github.com/repos/dpankros/meteor-schema-index/issues/comments{/number}","contents_url":"https://api.github.com/repos/dpankros/meteor-schema-index/contents/{+path}","compare_url":"https://api.github.com/repos/dpankros/meteor-schema-index/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dpankros/meteor-schema-index/merges","archive_url":"https://api.github.com/repos/dpankros/meteor-schema-index/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dpankros/meteor-schema-index/downloads","issues_url":"https://api.github.com/repos/dpankros/meteor-schema-index/issues{/number}","pulls_url":"https://api.github.com/repos/dpankros/meteor-schema-index/pulls{/number}","milestones_url":"https://api.github.com/repos/dpankros/meteor-schema-index/milestones{/number}","notifications_url":"https://api.github.com/repos/dpankros/meteor-schema-index/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dpankros/meteor-schema-index/labels{/name}","releases_url":"https://api.github.com/repos/dpankros/meteor-schema-index/releases{/id}","deployments_url":"https://api.github.com/repos/dpankros/meteor-schema-index/deployments","created_at":"2016-02-10T19:15:48Z","updated_at":"2016-02-10T19:15:49Z","pushed_at":"2016-02-11T17:18:53Z","git_url":"git://github.com/dpankros/meteor-schema-index.git","ssh_url":"git@github.com:dpankros/meteor-schema-index.git","clone_url":"https://github.com/dpankros/meteor-schema-index.git","svn_url":"https://github.com/dpankros/meteor-schema-index","homepage":null,"size":11,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"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":0,"default_branch":"master"}},"base":{"label":"aldeed:master","ref":"master","sha":"081cdf552ad3d906cb04c21fe9a7f40f863ee7bd","user":{"login":"aldeed","id":3012067,"avatar_url":"https://avatars.githubusercontent.com/u/3012067?v=3","gravatar_id":"","url":"https://api.github.com/users/aldeed","html_url":"https://github.com/aldeed","followers_url":"https://api.github.com/users/aldeed/followers","following_url":"https://api.github.com/users/aldeed/following{/other_user}","gists_url":"https://api.github.com/users/aldeed/gists{/gist_id}","starred_url":"https://api.github.com/users/aldeed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldeed/subscriptions","organizations_url":"https://api.github.com/users/aldeed/orgs","repos_url":"https://api.github.com/users/aldeed/repos","events_url":"https://api.github.com/users/aldeed/events{/privacy}","received_events_url":"https://api.github.com/users/aldeed/received_events","type":"User","site_admin":false},"repo":{"id":48114609,"name":"meteor-schema-index","full_name":"aldeed/meteor-schema-index","owner":{"login":"aldeed","id":3012067,"avatar_url":"https://avatars.githubusercontent.com/u/3012067?v=3","gravatar_id":"","url":"https://api.github.com/users/aldeed","html_url":"https://github.com/aldeed","followers_url":"https://api.github.com/users/aldeed/followers","following_url":"https://api.github.com/users/aldeed/following{/other_user}","gists_url":"https://api.github.com/users/aldeed/gists{/gist_id}","starred_url":"https://api.github.com/users/aldeed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldeed/subscriptions","organizations_url":"https://api.github.com/users/aldeed/orgs","repos_url":"https://api.github.com/users/aldeed/repos","events_url":"https://api.github.com/users/aldeed/events{/privacy}","received_events_url":"https://api.github.com/users/aldeed/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aldeed/meteor-schema-index","description":"Control some MongoDB indexing with schema options","fork":false,"url":"https://api.github.com/repos/aldeed/meteor-schema-index","forks_url":"https://api.github.com/repos/aldeed/meteor-schema-index/forks","keys_url":"https://api.github.com/repos/aldeed/meteor-schema-index/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aldeed/meteor-schema-index/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aldeed/meteor-schema-index/teams","hooks_url":"https://api.github.com/repos/aldeed/meteor-schema-index/hooks","issue_events_url":"https://api.github.com/repos/aldeed/meteor-schema-index/issues/events{/number}","events_url":"https://api.github.com/repos/aldeed/meteor-schema-index/events","assignees_url":"https://api.github.com/repos/aldeed/meteor-schema-index/assignees{/user}","branches_url":"https://api.github.com/repos/aldeed/meteor-schema-index/branches{/branch}","tags_url":"https://api.github.com/repos/aldeed/meteor-schema-index/tags","blobs_url":"https://api.github.com/repos/aldeed/meteor-schema-index/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aldeed/meteor-schema-index/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aldeed/meteor-schema-index/git/refs{/sha}","trees_url":"https://api.github.com/repos/aldeed/meteor-schema-index/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aldeed/meteor-schema-index/statuses/{sha}","languages_url":"https://api.github.com/repos/aldeed/meteor-schema-index/languages","stargazers_url":"https://api.github.com/repos/aldeed/meteor-schema-index/stargazers","contributors_url":"https://api.github.com/repos/aldeed/meteor-schema-index/contributors","subscribers_url":"https://api.github.com/repos/aldeed/meteor-schema-index/subscribers","subscription_url":"https://api.github.com/repos/aldeed/meteor-schema-index/subscription","commits_url":"https://api.github.com/repos/aldeed/meteor-schema-index/commits{/sha}","git_commits_url":"https://api.github.com/repos/aldeed/meteor-schema-index/git/commits{/sha}","comments_url":"https://api.github.com/repos/aldeed/meteor-schema-index/comments{/number}","issue_comment_url":"https://api.github.com/repos/aldeed/meteor-schema-index/issues/comments{/number}","contents_url":"https://api.github.com/repos/aldeed/meteor-schema-index/contents/{+path}","compare_url":"https://api.github.com/repos/aldeed/meteor-schema-index/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aldeed/meteor-schema-index/merges","archive_url":"https://api.github.com/repos/aldeed/meteor-schema-index/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aldeed/meteor-schema-index/downloads","issues_url":"https://api.github.com/repos/aldeed/meteor-schema-index/issues{/number}","pulls_url":"https://api.github.com/repos/aldeed/meteor-schema-index/pulls{/number}","milestones_url":"https://api.github.com/repos/aldeed/meteor-schema-index/milestones{/number}","notifications_url":"https://api.github.com/repos/aldeed/meteor-schema-index/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aldeed/meteor-schema-index/labels{/name}","releases_url":"https://api.github.com/repos/aldeed/meteor-schema-index/releases{/id}","deployments_url":"https://api.github.com/repos/aldeed/meteor-schema-index/deployments","created_at":"2015-12-16T14:19:20Z","updated_at":"2016-01-21T03:17:48Z","pushed_at":"2016-02-11T17:35:43Z","git_url":"git://github.com/aldeed/meteor-schema-index.git","ssh_url":"git@github.com:aldeed/meteor-schema-index.git","clone_url":"https://github.com/aldeed/meteor-schema-index.git","svn_url":"https://github.com/aldeed/meteor-schema-index","homepage":null,"size":7,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aldeed/meteor-schema-index/pulls/4"},"html":{"href":"https://github.com/aldeed/meteor-schema-index/pull/4"},"issue":{"href":"https://api.github.com/repos/aldeed/meteor-schema-index/issues/4"},"comments":{"href":"https://api.github.com/repos/aldeed/meteor-schema-index/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/aldeed/meteor-schema-index/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/aldeed/meteor-schema-index/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aldeed/meteor-schema-index/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/aldeed/meteor-schema-index/statuses/b725c6ca31372a3c61eaa7ef4589a207878f4396"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":365,"deletions":77,"changed_files":7}}