{"action":"created","issue":{"url":"https://api.github.com/repos/theryaz/veden-mongodb/issues/1","repository_url":"https://api.github.com/repos/theryaz/veden-mongodb","labels_url":"https://api.github.com/repos/theryaz/veden-mongodb/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/theryaz/veden-mongodb/issues/1/comments","events_url":"https://api.github.com/repos/theryaz/veden-mongodb/issues/1/events","html_url":"https://github.com/theryaz/veden-mongodb/issues/1","id":334087682,"node_id":"MDU6SXNzdWUzMzQwODc2ODI=","number":1,"title":"replaceOne Method requested","user":{"login":"spielma","id":10120254,"node_id":"MDQ6VXNlcjEwMTIwMjU0","avatar_url":"https://avatars1.githubusercontent.com/u/10120254?v=4","gravatar_id":"","url":"https://api.github.com/users/spielma","html_url":"https://github.com/spielma","followers_url":"https://api.github.com/users/spielma/followers","following_url":"https://api.github.com/users/spielma/following{/other_user}","gists_url":"https://api.github.com/users/spielma/gists{/gist_id}","starred_url":"https://api.github.com/users/spielma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spielma/subscriptions","organizations_url":"https://api.github.com/users/spielma/orgs","repos_url":"https://api.github.com/users/spielma/repos","events_url":"https://api.github.com/users/spielma/events{/privacy}","received_events_url":"https://api.github.com/users/spielma/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-20T13:50:26Z","updated_at":"2018-06-20T14:28:41Z","closed_at":"2018-06-20T14:28:41Z","author_association":"COLLABORATOR","body":"`let result = await db.collection(db_params.collection).update(query,body,{upsert: true});`\r\n\r\nWhen `db_params.overwrite == true`, it removes the $set, thereby throwing the error:\r\n`MongoError: the update operation document must contain atomic operators.` \r\n\r\nThe upsert flag here just inserts the document if none matched the query.  This is likely undesirable..?\r\n\r\n\r\nSuggestions:\r\n\r\n1.  implement a replaceOne() method, or \r\n2.  when db_params.overwrite == true,  use replaceOne instead of updateOne()"},"comment":{"url":"https://api.github.com/repos/theryaz/veden-mongodb/issues/comments/398769876","html_url":"https://github.com/theryaz/veden-mongodb/issues/1#issuecomment-398769876","issue_url":"https://api.github.com/repos/theryaz/veden-mongodb/issues/1","id":398769876,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODc2OTg3Ng==","user":{"login":"theryaz","id":8964034,"node_id":"MDQ6VXNlcjg5NjQwMzQ=","avatar_url":"https://avatars2.githubusercontent.com/u/8964034?v=4","gravatar_id":"","url":"https://api.github.com/users/theryaz","html_url":"https://github.com/theryaz","followers_url":"https://api.github.com/users/theryaz/followers","following_url":"https://api.github.com/users/theryaz/following{/other_user}","gists_url":"https://api.github.com/users/theryaz/gists{/gist_id}","starred_url":"https://api.github.com/users/theryaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theryaz/subscriptions","organizations_url":"https://api.github.com/users/theryaz/orgs","repos_url":"https://api.github.com/users/theryaz/repos","events_url":"https://api.github.com/users/theryaz/events{/privacy}","received_events_url":"https://api.github.com/users/theryaz/received_events","type":"User","site_admin":false},"created_at":"2018-06-20T14:28:41Z","updated_at":"2018-06-20T14:28:41Z","author_association":"OWNER","body":"Implemented in [733829f](https://github.com/theryaz/veden-mongodb/commit/733829f94513ecd4d61aba9384b0ed43d96ed366)"}}
{"actor":{"display_login":"theryaz"}}