{"action":"created","comment":{"url":"https://api.github.com/repos/olanguyenvan/binons/pulls/comments/231663103","pull_request_review_id":172681597,"id":231663103,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMTY2MzEwMw==","diff_hunk":"@@ -32,25 +38,50 @@ def get(self):\n \n         path_to_data = path_to_data_seperated_by_coma.split(',')\n         data_from_database = get_doc_dataset(token, database_name)\n-\n-        filtered_data = get_filtered_data(data_from_database['data'][0], path_to_data, parsed_data_filters,\n+        if isinstance(data_from_database, list):\n+            data_from_database = data_from_database[0]\n+        filtered_data = get_filtered_data(data_from_database, path_to_data, parsed_data_filters,\n                                           {\"x\": x_attribute_name, \"y\": y_attribute_name})\n         return filtered_data\n \n     def post(self):\n         self.authenticate()\n         data = request.get_json('data')\n         token = request.args.get('token', '')\n-        doc_name = request.args.get('doc_name', '')\n-        put_doc_with_update(token, doc_name, data)\n+        doc_name = request.args.get('database_name', '')\n+        put_doc_with_merge(token, doc_name, data)\n+\n \n     @staticmethod\n     def authenticate():\n         token = request.args.get('token', '')\n         abort_if_token_doesnt_exist(token)\n \n \n-def put_doc_with_update(token, doc_name, new_data):\n+def put_doc_with_merge(token, database_name, new_data):","path":"backend/client_api/resources.py","position":46,"original_position":46,"commit_id":"d0877b65dcf1d457829aefadd3dc22923ce8c990","original_commit_id":"d0877b65dcf1d457829aefadd3dc22923ce8c990","user":{"login":"olanguyenvan","id":13163939,"node_id":"MDQ6VXNlcjEzMTYzOTM5","avatar_url":"https://avatars1.githubusercontent.com/u/13163939?v=4","gravatar_id":"","url":"https://api.github.com/users/olanguyenvan","html_url":"https://github.com/olanguyenvan","followers_url":"https://api.github.com/users/olanguyenvan/followers","following_url":"https://api.github.com/users/olanguyenvan/following{/other_user}","gists_url":"https://api.github.com/users/olanguyenvan/gists{/gist_id}","starred_url":"https://api.github.com/users/olanguyenvan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olanguyenvan/subscriptions","organizations_url":"https://api.github.com/users/olanguyenvan/orgs","repos_url":"https://api.github.com/users/olanguyenvan/repos","events_url":"https://api.github.com/users/olanguyenvan/events{/privacy}","received_events_url":"https://api.github.com/users/olanguyenvan/received_events","type":"User","site_admin":false},"body":"Ja bym tę funkcję przeniosła do modułu mongo_db i w resources zostawiłabym tylko jej wywołanie","created_at":"2018-11-07T20:20:54Z","updated_at":"2018-11-07T20:20:55Z","html_url":"https://github.com/olanguyenvan/binons/pull/11#discussion_r231663103","pull_request_url":"https://api.github.com/repos/olanguyenvan/binons/pulls/11","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/olanguyenvan/binons/pulls/comments/231663103"},"html":{"href":"https://github.com/olanguyenvan/binons/pull/11#discussion_r231663103"},"pull_request":{"href":"https://api.github.com/repos/olanguyenvan/binons/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/olanguyenvan/binons/pulls/11","id":227423950,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI3NDIzOTUw","html_url":"https://github.com/olanguyenvan/binons/pull/11","diff_url":"https://github.com/olanguyenvan/binons/pull/11.diff","patch_url":"https://github.com/olanguyenvan/binons/pull/11.patch","issue_url":"https://api.github.com/repos/olanguyenvan/binons/issues/11","number":11,"state":"open","locked":false,"title":"Feat/merge docs objects","user":{"login":"WeraG","id":25345837,"node_id":"MDQ6VXNlcjI1MzQ1ODM3","avatar_url":"https://avatars3.githubusercontent.com/u/25345837?v=4","gravatar_id":"","url":"https://api.github.com/users/WeraG","html_url":"https://github.com/WeraG","followers_url":"https://api.github.com/users/WeraG/followers","following_url":"https://api.github.com/users/WeraG/following{/other_user}","gists_url":"https://api.github.com/users/WeraG/gists{/gist_id}","starred_url":"https://api.github.com/users/WeraG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WeraG/subscriptions","organizations_url":"https://api.github.com/users/WeraG/orgs","repos_url":"https://api.github.com/users/WeraG/repos","events_url":"https://api.github.com/users/WeraG/events{/privacy}","received_events_url":"https://api.github.com/users/WeraG/received_events","type":"User","site_admin":false},"body":"Branch for merging documents that are already in the database with docs that have just been sent and replacing previous document with \"merged\" one. ","created_at":"2018-10-31T20:02:57Z","updated_at":"2018-11-07T20:20:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2b86d23df33befe1d9cfa4337231d9f65908496c","assignee":{"login":"olanguyenvan","id":13163939,"node_id":"MDQ6VXNlcjEzMTYzOTM5","avatar_url":"https://avatars1.githubusercontent.com/u/13163939?v=4","gravatar_id":"","url":"https://api.github.com/users/olanguyenvan","html_url":"https://github.com/olanguyenvan","followers_url":"https://api.github.com/users/olanguyenvan/followers","following_url":"https://api.github.com/users/olanguyenvan/following{/other_user}","gists_url":"https://api.github.com/users/olanguyenvan/gists{/gist_id}","starred_url":"https://api.github.com/users/olanguyenvan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olanguyenvan/subscriptions","organizations_url":"https://api.github.com/users/olanguyenvan/orgs","repos_url":"https://api.github.com/users/olanguyenvan/repos","events_url":"https://api.github.com/users/olanguyenvan/events{/privacy}","received_events_url":"https://api.github.com/users/olanguyenvan/received_events","type":"User","site_admin":false},"assignees":[{"login":"olanguyenvan","id":13163939,"node_id":"MDQ6VXNlcjEzMTYzOTM5","avatar_url":"https://avatars1.githubusercontent.com/u/13163939?v=4","gravatar_id":"","url":"https://api.github.com/users/olanguyenvan","html_url":"https://github.com/olanguyenvan","followers_url":"https://api.github.com/users/olanguyenvan/followers","following_url":"https://api.github.com/users/olanguyenvan/following{/other_user}","gists_url":"https://api.github.com/users/olanguyenvan/gists{/gist_id}","starred_url":"https://api.github.com/users/olanguyenvan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olanguyenvan/subscriptions","organizations_url":"https://api.github.com/users/olanguyenvan/orgs","repos_url":"https://api.github.com/users/olanguyenvan/repos","events_url":"https://api.github.com/users/olanguyenvan/events{/privacy}","received_events_url":"https://api.github.com/users/olanguyenvan/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/olanguyenvan/binons/pulls/11/commits","review_comments_url":"https://api.github.com/repos/olanguyenvan/binons/pulls/11/comments","review_comment_url":"https://api.github.com/repos/olanguyenvan/binons/pulls/comments{/number}","comments_url":"https://api.github.com/repos/olanguyenvan/binons/issues/11/comments","statuses_url":"https://api.github.com/repos/olanguyenvan/binons/statuses/d0877b65dcf1d457829aefadd3dc22923ce8c990","head":{"label":"olanguyenvan:feat/merge-docs-objects","ref":"feat/merge-docs-objects","sha":"d0877b65dcf1d457829aefadd3dc22923ce8c990","user":{"login":"olanguyenvan","id":13163939,"node_id":"MDQ6VXNlcjEzMTYzOTM5","avatar_url":"https://avatars1.githubusercontent.com/u/13163939?v=4","gravatar_id":"","url":"https://api.github.com/users/olanguyenvan","html_url":"https://github.com/olanguyenvan","followers_url":"https://api.github.com/users/olanguyenvan/followers","following_url":"https://api.github.com/users/olanguyenvan/following{/other_user}","gists_url":"https://api.github.com/users/olanguyenvan/gists{/gist_id}","starred_url":"https://api.github.com/users/olanguyenvan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olanguyenvan/subscriptions","organizations_url":"https://api.github.com/users/olanguyenvan/orgs","repos_url":"https://api.github.com/users/olanguyenvan/repos","events_url":"https://api.github.com/users/olanguyenvan/events{/privacy}","received_events_url":"https://api.github.com/users/olanguyenvan/received_events","type":"User","site_admin":false},"repo":{"id":137105985,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcxMDU5ODU=","name":"binons","full_name":"olanguyenvan/binons","private":false,"owner":{"login":"olanguyenvan","id":13163939,"node_id":"MDQ6VXNlcjEzMTYzOTM5","avatar_url":"https://avatars1.githubusercontent.com/u/13163939?v=4","gravatar_id":"","url":"https://api.github.com/users/olanguyenvan","html_url":"https://github.com/olanguyenvan","followers_url":"https://api.github.com/users/olanguyenvan/followers","following_url":"https://api.github.com/users/olanguyenvan/following{/other_user}","gists_url":"https://api.github.com/users/olanguyenvan/gists{/gist_id}","starred_url":"https://api.github.com/users/olanguyenvan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olanguyenvan/subscriptions","organizations_url":"https://api.github.com/users/olanguyenvan/orgs","repos_url":"https://api.github.com/users/olanguyenvan/repos","events_url":"https://api.github.com/users/olanguyenvan/events{/privacy}","received_events_url":"https://api.github.com/users/olanguyenvan/received_events","type":"User","site_admin":false},"html_url":"https://github.com/olanguyenvan/binons","description":null,"fork":false,"url":"https://api.github.com/repos/olanguyenvan/binons","forks_url":"https://api.github.com/repos/olanguyenvan/binons/forks","keys_url":"https://api.github.com/repos/olanguyenvan/binons/keys{/key_id}","collaborators_url":"https://api.github.com/repos/olanguyenvan/binons/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/olanguyenvan/binons/teams","hooks_url":"https://api.github.com/repos/olanguyenvan/binons/hooks","issue_events_url":"https://api.github.com/repos/olanguyenvan/binons/issues/events{/number}","events_url":"https://api.github.com/repos/olanguyenvan/binons/events","assignees_url":"https://api.github.com/repos/olanguyenvan/binons/assignees{/user}","branches_url":"https://api.github.com/repos/olanguyenvan/binons/branches{/branch}","tags_url":"https://api.github.com/repos/olanguyenvan/binons/tags","blobs_url":"https://api.github.com/repos/olanguyenvan/binons/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/olanguyenvan/binons/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/olanguyenvan/binons/git/refs{/sha}","trees_url":"https://api.github.com/repos/olanguyenvan/binons/git/trees{/sha}","statuses_url":"https://api.github.com/repos/olanguyenvan/binons/statuses/{sha}","languages_url":"https://api.github.com/repos/olanguyenvan/binons/languages","stargazers_url":"https://api.github.com/repos/olanguyenvan/binons/stargazers","contributors_url":"https://api.github.com/repos/olanguyenvan/binons/contributors","subscribers_url":"https://api.github.com/repos/olanguyenvan/binons/subscribers","subscription_url":"https://api.github.com/repos/olanguyenvan/binons/subscription","commits_url":"https://api.github.com/repos/olanguyenvan/binons/commits{/sha}","git_commits_url":"https://api.github.com/repos/olanguyenvan/binons/git/commits{/sha}","comments_url":"https://api.github.com/repos/olanguyenvan/binons/comments{/number}","issue_comment_url":"https://api.github.com/repos/olanguyenvan/binons/issues/comments{/number}","contents_url":"https://api.github.com/repos/olanguyenvan/binons/contents/{+path}","compare_url":"https://api.github.com/repos/olanguyenvan/binons/compare/{base}...{head}","merges_url":"https://api.github.com/repos/olanguyenvan/binons/merges","archive_url":"https://api.github.com/repos/olanguyenvan/binons/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/olanguyenvan/binons/downloads","issues_url":"https://api.github.com/repos/olanguyenvan/binons/issues{/number}","pulls_url":"https://api.github.com/repos/olanguyenvan/binons/pulls{/number}","milestones_url":"https://api.github.com/repos/olanguyenvan/binons/milestones{/number}","notifications_url":"https://api.github.com/repos/olanguyenvan/binons/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/olanguyenvan/binons/labels{/name}","releases_url":"https://api.github.com/repos/olanguyenvan/binons/releases{/id}","deployments_url":"https://api.github.com/repos/olanguyenvan/binons/deployments","created_at":"2018-06-12T17:29:01Z","updated_at":"2018-11-04T23:55:44Z","pushed_at":"2018-11-07T19:51:43Z","git_url":"git://github.com/olanguyenvan/binons.git","ssh_url":"git@github.com:olanguyenvan/binons.git","clone_url":"https://github.com/olanguyenvan/binons.git","svn_url":"https://github.com/olanguyenvan/binons","homepage":null,"size":367,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"olanguyenvan:master","ref":"master","sha":"70a3b04096d59c76189b7ab646ce9ffeffd97d48","user":{"login":"olanguyenvan","id":13163939,"node_id":"MDQ6VXNlcjEzMTYzOTM5","avatar_url":"https://avatars1.githubusercontent.com/u/13163939?v=4","gravatar_id":"","url":"https://api.github.com/users/olanguyenvan","html_url":"https://github.com/olanguyenvan","followers_url":"https://api.github.com/users/olanguyenvan/followers","following_url":"https://api.github.com/users/olanguyenvan/following{/other_user}","gists_url":"https://api.github.com/users/olanguyenvan/gists{/gist_id}","starred_url":"https://api.github.com/users/olanguyenvan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olanguyenvan/subscriptions","organizations_url":"https://api.github.com/users/olanguyenvan/orgs","repos_url":"https://api.github.com/users/olanguyenvan/repos","events_url":"https://api.github.com/users/olanguyenvan/events{/privacy}","received_events_url":"https://api.github.com/users/olanguyenvan/received_events","type":"User","site_admin":false},"repo":{"id":137105985,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcxMDU5ODU=","name":"binons","full_name":"olanguyenvan/binons","private":false,"owner":{"login":"olanguyenvan","id":13163939,"node_id":"MDQ6VXNlcjEzMTYzOTM5","avatar_url":"https://avatars1.githubusercontent.com/u/13163939?v=4","gravatar_id":"","url":"https://api.github.com/users/olanguyenvan","html_url":"https://github.com/olanguyenvan","followers_url":"https://api.github.com/users/olanguyenvan/followers","following_url":"https://api.github.com/users/olanguyenvan/following{/other_user}","gists_url":"https://api.github.com/users/olanguyenvan/gists{/gist_id}","starred_url":"https://api.github.com/users/olanguyenvan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olanguyenvan/subscriptions","organizations_url":"https://api.github.com/users/olanguyenvan/orgs","repos_url":"https://api.github.com/users/olanguyenvan/repos","events_url":"https://api.github.com/users/olanguyenvan/events{/privacy}","received_events_url":"https://api.github.com/users/olanguyenvan/received_events","type":"User","site_admin":false},"html_url":"https://github.com/olanguyenvan/binons","description":null,"fork":false,"url":"https://api.github.com/repos/olanguyenvan/binons","forks_url":"https://api.github.com/repos/olanguyenvan/binons/forks","keys_url":"https://api.github.com/repos/olanguyenvan/binons/keys{/key_id}","collaborators_url":"https://api.github.com/repos/olanguyenvan/binons/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/olanguyenvan/binons/teams","hooks_url":"https://api.github.com/repos/olanguyenvan/binons/hooks","issue_events_url":"https://api.github.com/repos/olanguyenvan/binons/issues/events{/number}","events_url":"https://api.github.com/repos/olanguyenvan/binons/events","assignees_url":"https://api.github.com/repos/olanguyenvan/binons/assignees{/user}","branches_url":"https://api.github.com/repos/olanguyenvan/binons/branches{/branch}","tags_url":"https://api.github.com/repos/olanguyenvan/binons/tags","blobs_url":"https://api.github.com/repos/olanguyenvan/binons/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/olanguyenvan/binons/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/olanguyenvan/binons/git/refs{/sha}","trees_url":"https://api.github.com/repos/olanguyenvan/binons/git/trees{/sha}","statuses_url":"https://api.github.com/repos/olanguyenvan/binons/statuses/{sha}","languages_url":"https://api.github.com/repos/olanguyenvan/binons/languages","stargazers_url":"https://api.github.com/repos/olanguyenvan/binons/stargazers","contributors_url":"https://api.github.com/repos/olanguyenvan/binons/contributors","subscribers_url":"https://api.github.com/repos/olanguyenvan/binons/subscribers","subscription_url":"https://api.github.com/repos/olanguyenvan/binons/subscription","commits_url":"https://api.github.com/repos/olanguyenvan/binons/commits{/sha}","git_commits_url":"https://api.github.com/repos/olanguyenvan/binons/git/commits{/sha}","comments_url":"https://api.github.com/repos/olanguyenvan/binons/comments{/number}","issue_comment_url":"https://api.github.com/repos/olanguyenvan/binons/issues/comments{/number}","contents_url":"https://api.github.com/repos/olanguyenvan/binons/contents/{+path}","compare_url":"https://api.github.com/repos/olanguyenvan/binons/compare/{base}...{head}","merges_url":"https://api.github.com/repos/olanguyenvan/binons/merges","archive_url":"https://api.github.com/repos/olanguyenvan/binons/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/olanguyenvan/binons/downloads","issues_url":"https://api.github.com/repos/olanguyenvan/binons/issues{/number}","pulls_url":"https://api.github.com/repos/olanguyenvan/binons/pulls{/number}","milestones_url":"https://api.github.com/repos/olanguyenvan/binons/milestones{/number}","notifications_url":"https://api.github.com/repos/olanguyenvan/binons/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/olanguyenvan/binons/labels{/name}","releases_url":"https://api.github.com/repos/olanguyenvan/binons/releases{/id}","deployments_url":"https://api.github.com/repos/olanguyenvan/binons/deployments","created_at":"2018-06-12T17:29:01Z","updated_at":"2018-11-04T23:55:44Z","pushed_at":"2018-11-07T19:51:43Z","git_url":"git://github.com/olanguyenvan/binons.git","ssh_url":"git@github.com:olanguyenvan/binons.git","clone_url":"https://github.com/olanguyenvan/binons.git","svn_url":"https://github.com/olanguyenvan/binons","homepage":null,"size":367,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/olanguyenvan/binons/pulls/11"},"html":{"href":"https://github.com/olanguyenvan/binons/pull/11"},"issue":{"href":"https://api.github.com/repos/olanguyenvan/binons/issues/11"},"comments":{"href":"https://api.github.com/repos/olanguyenvan/binons/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/olanguyenvan/binons/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/olanguyenvan/binons/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/olanguyenvan/binons/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/olanguyenvan/binons/statuses/d0877b65dcf1d457829aefadd3dc22923ce8c990"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"olanguyenvan"}}