{"action":"created","comment":{"url":"https://api.github.com/repos/vdemedes/mongorito/pulls/comments/42308245","id":42308245,"diff_hunk":"@@ -32,14 +31,30 @@ const Query = require('./query');\n * Main class, manages mongodb connection and collections\n */\n \n+let mongoritoInstance = Symbol();\n+const MONGORITO_ENFORCER = Symbol();\n class Mongorito {\n+  constructor(enforcer){\n+    if(MONGORITO_ENFORCER !== enforcer) {\n+      throw new EnforcerError('Cannot directly construct a Mongorito');\n+    }\n+    this._collections = {};\n+  }\n+\n+  static get instance(){","path":"lib/mongorito.js","position":51,"original_position":51,"commit_id":"31b96c80241bdd87d0062f7051f9c30ed568dc0d","original_commit_id":"31b96c80241bdd87d0062f7051f9c30ed568dc0d","user":{"login":"vdemedes","id":697676,"avatar_url":"https://avatars.githubusercontent.com/u/697676?v=3","gravatar_id":"","url":"https://api.github.com/users/vdemedes","html_url":"https://github.com/vdemedes","followers_url":"https://api.github.com/users/vdemedes/followers","following_url":"https://api.github.com/users/vdemedes/following{/other_user}","gists_url":"https://api.github.com/users/vdemedes/gists{/gist_id}","starred_url":"https://api.github.com/users/vdemedes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vdemedes/subscriptions","organizations_url":"https://api.github.com/users/vdemedes/orgs","repos_url":"https://api.github.com/users/vdemedes/repos","events_url":"https://api.github.com/users/vdemedes/events{/privacy}","received_events_url":"https://api.github.com/users/vdemedes/received_events","type":"User","site_admin":false},"body":"Why did you switch to factory pattern?","created_at":"2015-10-17T11:06:36Z","updated_at":"2015-10-17T11:06:36Z","html_url":"https://github.com/vdemedes/mongorito/pull/59#discussion_r42308245","pull_request_url":"https://api.github.com/repos/vdemedes/mongorito/pulls/59","_links":{"self":{"href":"https://api.github.com/repos/vdemedes/mongorito/pulls/comments/42308245"},"html":{"href":"https://github.com/vdemedes/mongorito/pull/59#discussion_r42308245"},"pull_request":{"href":"https://api.github.com/repos/vdemedes/mongorito/pulls/59"}}},"pull_request":{"url":"https://api.github.com/repos/vdemedes/mongorito/pulls/59","id":47699994,"html_url":"https://github.com/vdemedes/mongorito/pull/59","diff_url":"https://github.com/vdemedes/mongorito/pull/59.diff","patch_url":"https://github.com/vdemedes/mongorito/pull/59.patch","issue_url":"https://api.github.com/repos/vdemedes/mongorito/issues/59","number":59,"state":"open","locked":false,"title":"Switch to native mongodb driver","user":{"login":"paullryan","id":3146164,"avatar_url":"https://avatars.githubusercontent.com/u/3146164?v=3","gravatar_id":"","url":"https://api.github.com/users/paullryan","html_url":"https://github.com/paullryan","followers_url":"https://api.github.com/users/paullryan/followers","following_url":"https://api.github.com/users/paullryan/following{/other_user}","gists_url":"https://api.github.com/users/paullryan/gists{/gist_id}","starred_url":"https://api.github.com/users/paullryan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paullryan/subscriptions","organizations_url":"https://api.github.com/users/paullryan/orgs","repos_url":"https://api.github.com/users/paullryan/repos","events_url":"https://api.github.com/users/paullryan/events{/privacy}","received_events_url":"https://api.github.com/users/paullryan/received_events","type":"User","site_admin":false},"body":"This is the beginnings of a switch to the native mongodb driver so that mongo 3.x is supported. This if functional but references to monk in the comments still need to replaced. Working on that now.","created_at":"2015-10-14T18:56:16Z","updated_at":"2015-10-17T11:06:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bc024534c651cb3a24f0eb48e7a628c73fffe0cc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/vdemedes/mongorito/pulls/59/commits","review_comments_url":"https://api.github.com/repos/vdemedes/mongorito/pulls/59/comments","review_comment_url":"https://api.github.com/repos/vdemedes/mongorito/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vdemedes/mongorito/issues/59/comments","statuses_url":"https://api.github.com/repos/vdemedes/mongorito/statuses/31b96c80241bdd87d0062f7051f9c30ed568dc0d","head":{"label":"SimplyComplexCo:mongodbDriver","ref":"mongodbDriver","sha":"31b96c80241bdd87d0062f7051f9c30ed568dc0d","user":{"login":"SimplyComplexCo","id":6378044,"avatar_url":"https://avatars.githubusercontent.com/u/6378044?v=3","gravatar_id":"","url":"https://api.github.com/users/SimplyComplexCo","html_url":"https://github.com/SimplyComplexCo","followers_url":"https://api.github.com/users/SimplyComplexCo/followers","following_url":"https://api.github.com/users/SimplyComplexCo/following{/other_user}","gists_url":"https://api.github.com/users/SimplyComplexCo/gists{/gist_id}","starred_url":"https://api.github.com/users/SimplyComplexCo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimplyComplexCo/subscriptions","organizations_url":"https://api.github.com/users/SimplyComplexCo/orgs","repos_url":"https://api.github.com/users/SimplyComplexCo/repos","events_url":"https://api.github.com/users/SimplyComplexCo/events{/privacy}","received_events_url":"https://api.github.com/users/SimplyComplexCo/received_events","type":"Organization","site_admin":false},"repo":{"id":44256799,"name":"mongorito","full_name":"SimplyComplexCo/mongorito","owner":{"login":"SimplyComplexCo","id":6378044,"avatar_url":"https://avatars.githubusercontent.com/u/6378044?v=3","gravatar_id":"","url":"https://api.github.com/users/SimplyComplexCo","html_url":"https://github.com/SimplyComplexCo","followers_url":"https://api.github.com/users/SimplyComplexCo/followers","following_url":"https://api.github.com/users/SimplyComplexCo/following{/other_user}","gists_url":"https://api.github.com/users/SimplyComplexCo/gists{/gist_id}","starred_url":"https://api.github.com/users/SimplyComplexCo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimplyComplexCo/subscriptions","organizations_url":"https://api.github.com/users/SimplyComplexCo/orgs","repos_url":"https://api.github.com/users/SimplyComplexCo/repos","events_url":"https://api.github.com/users/SimplyComplexCo/events{/privacy}","received_events_url":"https://api.github.com/users/SimplyComplexCo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SimplyComplexCo/mongorito","description":"ES6 generator-based MongoDB ODM for Node.js. It rocks.","fork":true,"url":"https://api.github.com/repos/SimplyComplexCo/mongorito","forks_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/forks","keys_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/teams","hooks_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/hooks","issue_events_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/issues/events{/number}","events_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/events","assignees_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/assignees{/user}","branches_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/branches{/branch}","tags_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/tags","blobs_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/git/refs{/sha}","trees_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/statuses/{sha}","languages_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/languages","stargazers_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/stargazers","contributors_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/contributors","subscribers_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/subscribers","subscription_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/subscription","commits_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/commits{/sha}","git_commits_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/git/commits{/sha}","comments_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/comments{/number}","issue_comment_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/issues/comments{/number}","contents_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/contents/{+path}","compare_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/merges","archive_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/downloads","issues_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/issues{/number}","pulls_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/pulls{/number}","milestones_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/milestones{/number}","notifications_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/labels{/name}","releases_url":"https://api.github.com/repos/SimplyComplexCo/mongorito/releases{/id}","created_at":"2015-10-14T15:22:07Z","updated_at":"2015-10-14T15:22:08Z","pushed_at":"2015-10-15T16:15:52Z","git_url":"git://github.com/SimplyComplexCo/mongorito.git","ssh_url":"git@github.com:SimplyComplexCo/mongorito.git","clone_url":"https://github.com/SimplyComplexCo/mongorito.git","svn_url":"https://github.com/SimplyComplexCo/mongorito","homepage":"http://mongorito.com","size":2269,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"vdemedes:master","ref":"master","sha":"b23f94afe42a111390000edc65c2c9c4bb3af779","user":{"login":"vdemedes","id":697676,"avatar_url":"https://avatars.githubusercontent.com/u/697676?v=3","gravatar_id":"","url":"https://api.github.com/users/vdemedes","html_url":"https://github.com/vdemedes","followers_url":"https://api.github.com/users/vdemedes/followers","following_url":"https://api.github.com/users/vdemedes/following{/other_user}","gists_url":"https://api.github.com/users/vdemedes/gists{/gist_id}","starred_url":"https://api.github.com/users/vdemedes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vdemedes/subscriptions","organizations_url":"https://api.github.com/users/vdemedes/orgs","repos_url":"https://api.github.com/users/vdemedes/repos","events_url":"https://api.github.com/users/vdemedes/events{/privacy}","received_events_url":"https://api.github.com/users/vdemedes/received_events","type":"User","site_admin":false},"repo":{"id":3458747,"name":"mongorito","full_name":"vdemedes/mongorito","owner":{"login":"vdemedes","id":697676,"avatar_url":"https://avatars.githubusercontent.com/u/697676?v=3","gravatar_id":"","url":"https://api.github.com/users/vdemedes","html_url":"https://github.com/vdemedes","followers_url":"https://api.github.com/users/vdemedes/followers","following_url":"https://api.github.com/users/vdemedes/following{/other_user}","gists_url":"https://api.github.com/users/vdemedes/gists{/gist_id}","starred_url":"https://api.github.com/users/vdemedes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vdemedes/subscriptions","organizations_url":"https://api.github.com/users/vdemedes/orgs","repos_url":"https://api.github.com/users/vdemedes/repos","events_url":"https://api.github.com/users/vdemedes/events{/privacy}","received_events_url":"https://api.github.com/users/vdemedes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vdemedes/mongorito","description":"ES6 generator-based MongoDB ODM for Node.js. It rocks.","fork":false,"url":"https://api.github.com/repos/vdemedes/mongorito","forks_url":"https://api.github.com/repos/vdemedes/mongorito/forks","keys_url":"https://api.github.com/repos/vdemedes/mongorito/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vdemedes/mongorito/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vdemedes/mongorito/teams","hooks_url":"https://api.github.com/repos/vdemedes/mongorito/hooks","issue_events_url":"https://api.github.com/repos/vdemedes/mongorito/issues/events{/number}","events_url":"https://api.github.com/repos/vdemedes/mongorito/events","assignees_url":"https://api.github.com/repos/vdemedes/mongorito/assignees{/user}","branches_url":"https://api.github.com/repos/vdemedes/mongorito/branches{/branch}","tags_url":"https://api.github.com/repos/vdemedes/mongorito/tags","blobs_url":"https://api.github.com/repos/vdemedes/mongorito/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vdemedes/mongorito/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vdemedes/mongorito/git/refs{/sha}","trees_url":"https://api.github.com/repos/vdemedes/mongorito/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vdemedes/mongorito/statuses/{sha}","languages_url":"https://api.github.com/repos/vdemedes/mongorito/languages","stargazers_url":"https://api.github.com/repos/vdemedes/mongorito/stargazers","contributors_url":"https://api.github.com/repos/vdemedes/mongorito/contributors","subscribers_url":"https://api.github.com/repos/vdemedes/mongorito/subscribers","subscription_url":"https://api.github.com/repos/vdemedes/mongorito/subscription","commits_url":"https://api.github.com/repos/vdemedes/mongorito/commits{/sha}","git_commits_url":"https://api.github.com/repos/vdemedes/mongorito/git/commits{/sha}","comments_url":"https://api.github.com/repos/vdemedes/mongorito/comments{/number}","issue_comment_url":"https://api.github.com/repos/vdemedes/mongorito/issues/comments{/number}","contents_url":"https://api.github.com/repos/vdemedes/mongorito/contents/{+path}","compare_url":"https://api.github.com/repos/vdemedes/mongorito/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vdemedes/mongorito/merges","archive_url":"https://api.github.com/repos/vdemedes/mongorito/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vdemedes/mongorito/downloads","issues_url":"https://api.github.com/repos/vdemedes/mongorito/issues{/number}","pulls_url":"https://api.github.com/repos/vdemedes/mongorito/pulls{/number}","milestones_url":"https://api.github.com/repos/vdemedes/mongorito/milestones{/number}","notifications_url":"https://api.github.com/repos/vdemedes/mongorito/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vdemedes/mongorito/labels{/name}","releases_url":"https://api.github.com/repos/vdemedes/mongorito/releases{/id}","created_at":"2012-02-16T09:53:59Z","updated_at":"2015-10-16T14:20:00Z","pushed_at":"2015-10-15T16:15:53Z","git_url":"git://github.com/vdemedes/mongorito.git","ssh_url":"git@github.com:vdemedes/mongorito.git","clone_url":"https://github.com/vdemedes/mongorito.git","svn_url":"https://github.com/vdemedes/mongorito","homepage":"http://mongorito.com","size":2269,"stargazers_count":383,"watchers_count":383,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":24,"mirror_url":null,"open_issues_count":6,"forks":24,"open_issues":6,"watchers":383,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vdemedes/mongorito/pulls/59"},"html":{"href":"https://github.com/vdemedes/mongorito/pull/59"},"issue":{"href":"https://api.github.com/repos/vdemedes/mongorito/issues/59"},"comments":{"href":"https://api.github.com/repos/vdemedes/mongorito/issues/59/comments"},"review_comments":{"href":"https://api.github.com/repos/vdemedes/mongorito/pulls/59/comments"},"review_comment":{"href":"https://api.github.com/repos/vdemedes/mongorito/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vdemedes/mongorito/pulls/59/commits"},"statuses":{"href":"https://api.github.com/repos/vdemedes/mongorito/statuses/31b96c80241bdd87d0062f7051f9c30ed568dc0d"}}}}