{"action":"created","issue":{"url":"https://api.github.com/repos/parse-community/parse-server/issues/4597","repository_url":"https://api.github.com/repos/parse-community/parse-server","labels_url":"https://api.github.com/repos/parse-community/parse-server/issues/4597/labels{/name}","comments_url":"https://api.github.com/repos/parse-community/parse-server/issues/4597/comments","events_url":"https://api.github.com/repos/parse-community/parse-server/issues/4597/events","html_url":"https://github.com/parse-community/parse-server/issues/4597","id":301595779,"number":4597,"title":"Saving PFFile with postgres: error: Invalid schema, expected `mongodb` or `mongodb+srv` Error: Invalid schema, expected `mongodb` or `mongodb+srv`","user":{"login":"mindgrub-jkliphouse","id":12276356,"avatar_url":"https://avatars3.githubusercontent.com/u/12276356?v=4","gravatar_id":"","url":"https://api.github.com/users/mindgrub-jkliphouse","html_url":"https://github.com/mindgrub-jkliphouse","followers_url":"https://api.github.com/users/mindgrub-jkliphouse/followers","following_url":"https://api.github.com/users/mindgrub-jkliphouse/following{/other_user}","gists_url":"https://api.github.com/users/mindgrub-jkliphouse/gists{/gist_id}","starred_url":"https://api.github.com/users/mindgrub-jkliphouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mindgrub-jkliphouse/subscriptions","organizations_url":"https://api.github.com/users/mindgrub-jkliphouse/orgs","repos_url":"https://api.github.com/users/mindgrub-jkliphouse/repos","events_url":"https://api.github.com/users/mindgrub-jkliphouse/events{/privacy}","received_events_url":"https://api.github.com/users/mindgrub-jkliphouse/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-01T23:15:21Z","updated_at":"2018-03-02T07:57:23Z","closed_at":null,"author_association":"NONE","body":"\r\n### Issue Description\r\n\r\nUsing postgres instead of mongodb.  Try to save a PFFile on and get this error:\r\n\r\n`error: Invalid schema, expected mongodb or mongodb+srv Error: Invalid schema, expected mongodb or mongodb+srv`\r\n\r\nI'm saving an object as such:\r\n\r\n`newObject.save({\r\n    photo: new Parse.File('myfile.txt', {base64: image}),\r\n    ...\r\n }); `\r\n\r\nLooking through GridStoreAdapter I see \r\n\r\n> /**\r\n>                                               GridStoreAdapter\r\n>                                               Stores files in Mongo using GridStore\r\n>                                               Requires the database adapter to be based on mongoclient\r\n>                                              \r\n>                                                weak\r\n>                                               */\r\n\r\nI don't see a postgres client.  Does this mean we can't save PFFiles if we're using postgres?   I've used mongodb but wanted to try postgres.\r\n\r\n### Steps to reproduce\r\n\r\nUse postgres and try to save a PFFile.\r\n\r\n#### Expected Results\r\n\r\nYou can save PFFiles using postgres\r\n\r\n#### Actual Outcome\r\n\r\nI get the above error.\r\n\r\n### Environment Setup\r\n\r\n- **Server**\r\n  - \"^2.7.2\",\r\n  - happens locally on mac and on heroku\r\n\r\n- **Database**\r\n  - MongoDB version: None\r\n  - Heroku postgres and postgres for mac\r\n\r\n### Logs/Trace\r\n\r\nerror: Invalid schema, expected `mongodb` or `mongodb+srv` Error: Invalid schema, expected `mongodb` or `mongodb+srv`\r\n    at module.exports (/Users/user/node/project-server/node_modules/mongodb/lib/url_parser.js:15:21)\r\n    at connect (/Users/user/node/project-server/node_modules/mongodb/lib/mongo_client.js:867:3)\r\n    at connectOp (/Users/user/node/project-server/node_modules/mongodb/lib/mongo_client.js:253:3)\r\n    at /Users/user/node/project-server/node_modules/mongodb/lib/utils.js:432:15\r\n    at new Promise (<anonymous>)\r\n    at executeOperation (/Users/user/node/project-server/node_modules/mongodb/lib/utils.js:416:10)\r\n    at MongoClient.connect (/Users/user/node/project-server/node_modules/mongodb/lib/mongo_client.js:244:10)\r\n    at Function.MongoClient.connect (/Users/user/node/project-server/node_modules/mongodb/lib/mongo_client.js:472:22)\r\n    at GridStoreAdapter._connect (/Users/user/node/project-server/node_modules/parse-server/lib/Adapters/Files/GridStoreAdapter.js:27:54)\r\n    at GridStoreAdapter.createFile (/Users/user/node/project-server/node_modules/parse-server/lib/Adapters/Files/GridStoreAdapter.js:35:17)\r\nerror: Could not store file. code=130, message=Could not store file.\r\n"},"comment":{"url":"https://api.github.com/repos/parse-community/parse-server/issues/comments/369849071","html_url":"https://github.com/parse-community/parse-server/issues/4597#issuecomment-369849071","issue_url":"https://api.github.com/repos/parse-community/parse-server/issues/4597","id":369849071,"user":{"login":"bohemima","id":195410,"avatar_url":"https://avatars0.githubusercontent.com/u/195410?v=4","gravatar_id":"","url":"https://api.github.com/users/bohemima","html_url":"https://github.com/bohemima","followers_url":"https://api.github.com/users/bohemima/followers","following_url":"https://api.github.com/users/bohemima/following{/other_user}","gists_url":"https://api.github.com/users/bohemima/gists{/gist_id}","starred_url":"https://api.github.com/users/bohemima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bohemima/subscriptions","organizations_url":"https://api.github.com/users/bohemima/orgs","repos_url":"https://api.github.com/users/bohemima/repos","events_url":"https://api.github.com/users/bohemima/events{/privacy}","received_events_url":"https://api.github.com/users/bohemima/received_events","type":"User","site_admin":false},"created_at":"2018-03-02T07:57:23Z","updated_at":"2018-03-02T07:57:23Z","author_association":"CONTRIBUTOR","body":"Have a look at https://github.com/parse-community/parse-server-fs-adapter instead of GridFsAdapter (which is default IIRC)"}}
{"actor":{"display_login":"bohemima"}}