{"action":"created","comment":{"url":"https://api.github.com/repos/prismagraphql/prisma/pulls/comments/210099984","pull_request_review_id":146247535,"id":210099984,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMDA5OTk4NA==","diff_hunk":"@@ -0,0 +1,44 @@\n+package com.prisma.api.connector.mongo.database\n+\n+import com.prisma.api.connector.mongo.DocumentToRoot\n+import com.prisma.api.connector.mongo.database.NodeSelectorBsonTransformer.WhereToBson\n+import com.prisma.api.connector.{Filter, NodeSelector, PrismaNode, SelectedFields}\n+import com.prisma.gc_values.IdGCValue\n+import com.prisma.shared.models.{Model, RelationField, Schema}\n+import org.mongodb.scala.{Document, MongoCollection, MongoDatabase}\n+\n+import scala.concurrent.ExecutionContext.Implicits.global\n+import scala.concurrent.{ExecutionContext, Future}\n+import scala.language.existentials\n+\n+trait NodeSingleQueries {\n+\n+  def getModelForGlobalId(schema: Schema, idGCValue: IdGCValue) = ???\n+\n+  def getNodeByWhere(where: NodeSelector, database: MongoDatabase): Future[Option[PrismaNode]] =\n+    getNodeByWhere(where, SelectedFields.all(where.model), database)\n+\n+  def getNodeByWhere(where: NodeSelector, selectedFields: SelectedFields, database: MongoDatabase): Future[Option[PrismaNode]] = {\n+    val collection: MongoCollection[Document] = database.getCollection(where.model.dbName)\n+    collection.find(WhereToBson(where)).collect().toFuture.map { results: Seq[Document] =>\n+      results.headOption.map { result =>\n+        val root = DocumentToRoot(where.model, result)\n+        PrismaNode(root.idField, root)\n+      }\n+    }\n+  }\n+\n+  def getNodeIdByWhere(where: NodeSelector) = ???\n+\n+  def getNodeIdByParentId(parentField: RelationField, parentId: IdGCValue)(implicit ec: ExecutionContext) = ???","path":"server/connectors/api-connector-mongo/src/main/scala/com/prisma/api/connector/mongo/database/NodeSingleQueries.scala","position":33,"original_position":33,"commit_id":"2a33632bd19894d44256948cdf75f10139255f5f","original_commit_id":"2a33632bd19894d44256948cdf75f10139255f5f","user":{"login":"codacy-bot","id":19940114,"node_id":"MDQ6VXNlcjE5OTQwMTE0","avatar_url":"https://avatars1.githubusercontent.com/u/19940114?v=4","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://app.codacy.com/assets/images/favicon.png) Issue found: [Usage of ??? operator](https://app.codacy.com/app/graphcool/prisma/pullRequest?prid=2002555)","created_at":"2018-08-14T20:53:41Z","updated_at":"2018-08-14T20:53:41Z","html_url":"https://github.com/prismagraphql/prisma/pull/2883#discussion_r210099984","pull_request_url":"https://api.github.com/repos/prismagraphql/prisma/pulls/2883","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/prismagraphql/prisma/pulls/comments/210099984"},"html":{"href":"https://github.com/prismagraphql/prisma/pull/2883#discussion_r210099984"},"pull_request":{"href":"https://api.github.com/repos/prismagraphql/prisma/pulls/2883"}}},"pull_request":{"url":"https://api.github.com/repos/prismagraphql/prisma/pulls/2883","id":206375310,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2Mzc1MzEw","html_url":"https://github.com/prismagraphql/prisma/pull/2883","diff_url":"https://github.com/prismagraphql/prisma/pull/2883.diff","patch_url":"https://github.com/prismagraphql/prisma/pull/2883.patch","issue_url":"https://api.github.com/repos/prismagraphql/prisma/issues/2883","number":2883,"state":"open","locked":false,"title":"[WIP] Mongo db connector","user":{"login":"do4gr","id":16278407,"node_id":"MDQ6VXNlcjE2Mjc4NDA3","avatar_url":"https://avatars2.githubusercontent.com/u/16278407?v=4","gravatar_id":"","url":"https://api.github.com/users/do4gr","html_url":"https://github.com/do4gr","followers_url":"https://api.github.com/users/do4gr/followers","following_url":"https://api.github.com/users/do4gr/following{/other_user}","gists_url":"https://api.github.com/users/do4gr/gists{/gist_id}","starred_url":"https://api.github.com/users/do4gr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/do4gr/subscriptions","organizations_url":"https://api.github.com/users/do4gr/orgs","repos_url":"https://api.github.com/users/do4gr/repos","events_url":"https://api.github.com/users/do4gr/events{/privacy}","received_events_url":"https://api.github.com/users/do4gr/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-08-06T11:56:35Z","updated_at":"2018-08-14T20:53:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c27ea3e6a3f06553d46f948658f3831b5a0750bd","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/prismagraphql/prisma/pulls/2883/commits","review_comments_url":"https://api.github.com/repos/prismagraphql/prisma/pulls/2883/comments","review_comment_url":"https://api.github.com/repos/prismagraphql/prisma/pulls/comments{/number}","comments_url":"https://api.github.com/repos/prismagraphql/prisma/issues/2883/comments","statuses_url":"https://api.github.com/repos/prismagraphql/prisma/statuses/2a33632bd19894d44256948cdf75f10139255f5f","head":{"label":"prismagraphql:MongoDBConnector","ref":"MongoDBConnector","sha":"2a33632bd19894d44256948cdf75f10139255f5f","user":{"login":"prismagraphql","id":17219288,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3MjE5Mjg4","avatar_url":"https://avatars0.githubusercontent.com/u/17219288?v=4","gravatar_id":"","url":"https://api.github.com/users/prismagraphql","html_url":"https://github.com/prismagraphql","followers_url":"https://api.github.com/users/prismagraphql/followers","following_url":"https://api.github.com/users/prismagraphql/following{/other_user}","gists_url":"https://api.github.com/users/prismagraphql/gists{/gist_id}","starred_url":"https://api.github.com/users/prismagraphql/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prismagraphql/subscriptions","organizations_url":"https://api.github.com/users/prismagraphql/orgs","repos_url":"https://api.github.com/users/prismagraphql/repos","events_url":"https://api.github.com/users/prismagraphql/events{/privacy}","received_events_url":"https://api.github.com/users/prismagraphql/received_events","type":"Organization","site_admin":false},"repo":{"id":69164196,"node_id":"MDEwOlJlcG9zaXRvcnk2OTE2NDE5Ng==","name":"prisma","full_name":"prismagraphql/prisma","owner":{"login":"prismagraphql","id":17219288,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3MjE5Mjg4","avatar_url":"https://avatars0.githubusercontent.com/u/17219288?v=4","gravatar_id":"","url":"https://api.github.com/users/prismagraphql","html_url":"https://github.com/prismagraphql","followers_url":"https://api.github.com/users/prismagraphql/followers","following_url":"https://api.github.com/users/prismagraphql/following{/other_user}","gists_url":"https://api.github.com/users/prismagraphql/gists{/gist_id}","starred_url":"https://api.github.com/users/prismagraphql/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prismagraphql/subscriptions","organizations_url":"https://api.github.com/users/prismagraphql/orgs","repos_url":"https://api.github.com/users/prismagraphql/repos","events_url":"https://api.github.com/users/prismagraphql/events{/privacy}","received_events_url":"https://api.github.com/users/prismagraphql/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/prismagraphql/prisma","description":"⚡️ Prisma turns your database into a realtime GraphQL API","fork":false,"url":"https://api.github.com/repos/prismagraphql/prisma","forks_url":"https://api.github.com/repos/prismagraphql/prisma/forks","keys_url":"https://api.github.com/repos/prismagraphql/prisma/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prismagraphql/prisma/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prismagraphql/prisma/teams","hooks_url":"https://api.github.com/repos/prismagraphql/prisma/hooks","issue_events_url":"https://api.github.com/repos/prismagraphql/prisma/issues/events{/number}","events_url":"https://api.github.com/repos/prismagraphql/prisma/events","assignees_url":"https://api.github.com/repos/prismagraphql/prisma/assignees{/user}","branches_url":"https://api.github.com/repos/prismagraphql/prisma/branches{/branch}","tags_url":"https://api.github.com/repos/prismagraphql/prisma/tags","blobs_url":"https://api.github.com/repos/prismagraphql/prisma/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prismagraphql/prisma/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prismagraphql/prisma/git/refs{/sha}","trees_url":"https://api.github.com/repos/prismagraphql/prisma/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prismagraphql/prisma/statuses/{sha}","languages_url":"https://api.github.com/repos/prismagraphql/prisma/languages","stargazers_url":"https://api.github.com/repos/prismagraphql/prisma/stargazers","contributors_url":"https://api.github.com/repos/prismagraphql/prisma/contributors","subscribers_url":"https://api.github.com/repos/prismagraphql/prisma/subscribers","subscription_url":"https://api.github.com/repos/prismagraphql/prisma/subscription","commits_url":"https://api.github.com/repos/prismagraphql/prisma/commits{/sha}","git_commits_url":"https://api.github.com/repos/prismagraphql/prisma/git/commits{/sha}","comments_url":"https://api.github.com/repos/prismagraphql/prisma/comments{/number}","issue_comment_url":"https://api.github.com/repos/prismagraphql/prisma/issues/comments{/number}","contents_url":"https://api.github.com/repos/prismagraphql/prisma/contents/{+path}","compare_url":"https://api.github.com/repos/prismagraphql/prisma/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prismagraphql/prisma/merges","archive_url":"https://api.github.com/repos/prismagraphql/prisma/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prismagraphql/prisma/downloads","issues_url":"https://api.github.com/repos/prismagraphql/prisma/issues{/number}","pulls_url":"https://api.github.com/repos/prismagraphql/prisma/pulls{/number}","milestones_url":"https://api.github.com/repos/prismagraphql/prisma/milestones{/number}","notifications_url":"https://api.github.com/repos/prismagraphql/prisma/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prismagraphql/prisma/labels{/name}","releases_url":"https://api.github.com/repos/prismagraphql/prisma/releases{/id}","deployments_url":"https://api.github.com/repos/prismagraphql/prisma/deployments","created_at":"2016-09-25T12:54:40Z","updated_at":"2018-08-14T18:43:30Z","pushed_at":"2018-08-14T20:49:59Z","git_url":"git://github.com/prismagraphql/prisma.git","ssh_url":"git@github.com:prismagraphql/prisma.git","clone_url":"https://github.com/prismagraphql/prisma.git","svn_url":"https://github.com/prismagraphql/prisma","homepage":"https://www.prisma.io/","size":19416,"stargazers_count":9722,"watchers_count":9722,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":541,"mirror_url":null,"archived":false,"open_issues_count":407,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":541,"open_issues":407,"watchers":9722,"default_branch":"master"}},"base":{"label":"prismagraphql:alpha","ref":"alpha","sha":"fbe3d1a83978f9541cd1c3a6768cb709fb53c8b4","user":{"login":"prismagraphql","id":17219288,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3MjE5Mjg4","avatar_url":"https://avatars0.githubusercontent.com/u/17219288?v=4","gravatar_id":"","url":"https://api.github.com/users/prismagraphql","html_url":"https://github.com/prismagraphql","followers_url":"https://api.github.com/users/prismagraphql/followers","following_url":"https://api.github.com/users/prismagraphql/following{/other_user}","gists_url":"https://api.github.com/users/prismagraphql/gists{/gist_id}","starred_url":"https://api.github.com/users/prismagraphql/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prismagraphql/subscriptions","organizations_url":"https://api.github.com/users/prismagraphql/orgs","repos_url":"https://api.github.com/users/prismagraphql/repos","events_url":"https://api.github.com/users/prismagraphql/events{/privacy}","received_events_url":"https://api.github.com/users/prismagraphql/received_events","type":"Organization","site_admin":false},"repo":{"id":69164196,"node_id":"MDEwOlJlcG9zaXRvcnk2OTE2NDE5Ng==","name":"prisma","full_name":"prismagraphql/prisma","owner":{"login":"prismagraphql","id":17219288,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3MjE5Mjg4","avatar_url":"https://avatars0.githubusercontent.com/u/17219288?v=4","gravatar_id":"","url":"https://api.github.com/users/prismagraphql","html_url":"https://github.com/prismagraphql","followers_url":"https://api.github.com/users/prismagraphql/followers","following_url":"https://api.github.com/users/prismagraphql/following{/other_user}","gists_url":"https://api.github.com/users/prismagraphql/gists{/gist_id}","starred_url":"https://api.github.com/users/prismagraphql/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prismagraphql/subscriptions","organizations_url":"https://api.github.com/users/prismagraphql/orgs","repos_url":"https://api.github.com/users/prismagraphql/repos","events_url":"https://api.github.com/users/prismagraphql/events{/privacy}","received_events_url":"https://api.github.com/users/prismagraphql/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/prismagraphql/prisma","description":"⚡️ Prisma turns your database into a realtime GraphQL API","fork":false,"url":"https://api.github.com/repos/prismagraphql/prisma","forks_url":"https://api.github.com/repos/prismagraphql/prisma/forks","keys_url":"https://api.github.com/repos/prismagraphql/prisma/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prismagraphql/prisma/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prismagraphql/prisma/teams","hooks_url":"https://api.github.com/repos/prismagraphql/prisma/hooks","issue_events_url":"https://api.github.com/repos/prismagraphql/prisma/issues/events{/number}","events_url":"https://api.github.com/repos/prismagraphql/prisma/events","assignees_url":"https://api.github.com/repos/prismagraphql/prisma/assignees{/user}","branches_url":"https://api.github.com/repos/prismagraphql/prisma/branches{/branch}","tags_url":"https://api.github.com/repos/prismagraphql/prisma/tags","blobs_url":"https://api.github.com/repos/prismagraphql/prisma/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prismagraphql/prisma/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prismagraphql/prisma/git/refs{/sha}","trees_url":"https://api.github.com/repos/prismagraphql/prisma/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prismagraphql/prisma/statuses/{sha}","languages_url":"https://api.github.com/repos/prismagraphql/prisma/languages","stargazers_url":"https://api.github.com/repos/prismagraphql/prisma/stargazers","contributors_url":"https://api.github.com/repos/prismagraphql/prisma/contributors","subscribers_url":"https://api.github.com/repos/prismagraphql/prisma/subscribers","subscription_url":"https://api.github.com/repos/prismagraphql/prisma/subscription","commits_url":"https://api.github.com/repos/prismagraphql/prisma/commits{/sha}","git_commits_url":"https://api.github.com/repos/prismagraphql/prisma/git/commits{/sha}","comments_url":"https://api.github.com/repos/prismagraphql/prisma/comments{/number}","issue_comment_url":"https://api.github.com/repos/prismagraphql/prisma/issues/comments{/number}","contents_url":"https://api.github.com/repos/prismagraphql/prisma/contents/{+path}","compare_url":"https://api.github.com/repos/prismagraphql/prisma/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prismagraphql/prisma/merges","archive_url":"https://api.github.com/repos/prismagraphql/prisma/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prismagraphql/prisma/downloads","issues_url":"https://api.github.com/repos/prismagraphql/prisma/issues{/number}","pulls_url":"https://api.github.com/repos/prismagraphql/prisma/pulls{/number}","milestones_url":"https://api.github.com/repos/prismagraphql/prisma/milestones{/number}","notifications_url":"https://api.github.com/repos/prismagraphql/prisma/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prismagraphql/prisma/labels{/name}","releases_url":"https://api.github.com/repos/prismagraphql/prisma/releases{/id}","deployments_url":"https://api.github.com/repos/prismagraphql/prisma/deployments","created_at":"2016-09-25T12:54:40Z","updated_at":"2018-08-14T18:43:30Z","pushed_at":"2018-08-14T20:49:59Z","git_url":"git://github.com/prismagraphql/prisma.git","ssh_url":"git@github.com:prismagraphql/prisma.git","clone_url":"https://github.com/prismagraphql/prisma.git","svn_url":"https://github.com/prismagraphql/prisma","homepage":"https://www.prisma.io/","size":19416,"stargazers_count":9722,"watchers_count":9722,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":541,"mirror_url":null,"archived":false,"open_issues_count":407,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":541,"open_issues":407,"watchers":9722,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prismagraphql/prisma/pulls/2883"},"html":{"href":"https://github.com/prismagraphql/prisma/pull/2883"},"issue":{"href":"https://api.github.com/repos/prismagraphql/prisma/issues/2883"},"comments":{"href":"https://api.github.com/repos/prismagraphql/prisma/issues/2883/comments"},"review_comments":{"href":"https://api.github.com/repos/prismagraphql/prisma/pulls/2883/comments"},"review_comment":{"href":"https://api.github.com/repos/prismagraphql/prisma/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/prismagraphql/prisma/pulls/2883/commits"},"statuses":{"href":"https://api.github.com/repos/prismagraphql/prisma/statuses/2a33632bd19894d44256948cdf75f10139255f5f"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"codacy-bot"}}