Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property '_id' of undefined When I try to add a product #6

Open
HackIvan opened this issue Jun 11, 2020 · 1 comment

Comments

@HackIvan
Copy link

55 | }
56 |
57 | const variables = {

58 | writer: props.user.userData._id,
| ^ 59 | title: TitleValue,
60 | description: DescriptionValue,
61 | price: PriceValue,

I've created a mongo db account and I've created the dev.js file adding the credentials to in for accessing the database

@vishchi
Copy link

vishchi commented Jul 22, 2020

Yeah one thing, he mistakenly kept those <> around password and dbname inside the dev.js(config) file. You are supposed to remove those. It should look like:
module.exports = {
mongoURI:'mongodb+srv://bla_user:[email protected]/test?retryWrites=true&w=majority'
}
and if you don't already have a database created, please go and create in 'collections' section. In my case, it is named "test".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants