Open gbowne1 opened 1 year ago
hello @gbowne1 ....can u please assign this to me......i think i will be able to this
ok @Gourav2609 I will assign you.
Thanks @gbowne1 for giving this opportunity....this is going to be my first time experience....thanks a lot.....
You're welcome @Gourav2609.
@gbowne1 can u please help me here ...i have tried it
i have created the .env file
@LOGESH-B
Any ideas? I was not able to replicate this error.
@Gourav2609
I will say that the connection string in the MONGO_DB string should be:
MONGO_DB=mongodb://username:password@localhost:27017/codebooker
replace username and password with your local database password and make sure there is an : in between them
I also will say that it won't work without starting the mongod
server first and then using either mongo
or mongosh
to create the codebooker
database by doing use codebooker
in either mongo or mongosh. If you use MongoDB compass, MongoDB atlas or the MongoDB extension in VSCode the workflow will be a bit different. You can use whatever database name you want in place of codebooker
.
Well, yes and no.
The insertOne() method is not a native method of Mongoose. It is a method provided by the MongoDB Node.js driver aka mongodb package
In Mongoose, you can use the create() method to insert a document into a collection
If you want to use the insertOne() method from the MongoDB Node.js driver directly, you can access the underlying collection object using Model.collection and then call the insertOne() method on it.
We can also define a schema for a user and create a model using mongoose.model(). We then create a new document and use the create() method of the model to insert the document into the collection. The create() method returns a promise, so we can use .then() and .catch() to handle the success and error cases, respectively.
Again, Gourav2609 is running across a timer/timing problem, among another issue on top of that.
I also will say that it won't work without starting the
mongod
server first and then using eithermongo
ormongosh
to create thecodebooker
database by doinguse codebooker
in either mongo or mongosh. If you use MongoDB compass, MongoDB atlas or the MongoDB extension in VSCode the workflow will be a bit different. You can use whatever database name you want in place ofcodebooker
.
actually i was using mongoDB campass
@Gourav2609
I don't think you'll need to run setup.js if you use MongoDB compass. All setup.js does is create a test user.
That can be done like this in Compass, according to some documentation.
To create a test user using MongoDB Compass, you don't need to run the setup.js file mentioned in your previous question. Instead, you can follow these general steps:
Open MongoDB Compass and connect to your MongoDB server instance. You can refer to the MongoDB Compass documentation for detailed instructions on how to connect.
Once connected, navigate to the database where you want to create the test user.
In the database view, look for an option to create a new user. The exact steps may vary depending on the version of MongoDB Compass you are using. Typically, you would find an option like "Create Database User" or "Add User". Click on that option.
Enter the necessary details for the test user, such as username, password and email.
Save the user configuration. MongoDB Compass will create the user in the specified authentication database.
By following these steps, you should be able to create a test user in your MongoDB database using MongoDB Compass without the need to run the setup.js file.
thanks @gbowne1 I will try it and get back to you if I face any issues..
yeah, Please do let @LOGESH-B and me know about any issues you have. He uses Atlas. I use mongod and mongosh locally in the console/terminal. I've never used Compass or Atlas so I don't know how that worflow goes, just did some reading to find out those steps.
The test user this workflow should allow you to log into the app.
Hello @gbowne1 and @LOGESH-B ,
1. Ran MongoDB server
2. Ran mongosh command****
3.Ran setup.js
4. Ran index.js
5. Copied username and password from users and pasted it in React App
@Gourav2609 that is because you copied the hash of the password into the react app. the actual password is test
iirc. Looks like everything else went along fine though. It succesfully created the test user after running the setup.js.
Oh and thanks for the screenshots too. :+1: :100:
@gbowne1 thanks for the correction now i was able to open it i was thinking since i learned a lot during setup for the project ........how about me contributing to a proper documentation about setup of the project
Thanks @Gourav2609! Glad that helped out. Yes the test user login information is in the User model/schema.
Yes, and you're always always welcome to work on anything you feel like working on. There is an issue for adding MongoDB Compass/Atlas #137
Any documentation go in /docs/ and also linked in the README's.
They will eventually get cross posted to the Wiki.. there is an issue for that #141
I forgot to add, that once in mongo or mongosh shell (either shell works) switch to the database using the command use codebooker
to switch to using the database, and if it is not created alreadfy it will create codebooker
.
@gbowne1
i was thinking of creating a similar column with a name Favourite
initially every book contains whenever a book is added to favorites the icon changes to
using same color pallets and displaying them
how do you think this would be
@Gourav2609 I love the idea about changing the icon filled state when the favorite gets added.
Would clicking on Favorites in the dropdown/context menu there show all the favorited items?
We would have to figure out where to put a heart / favorite icon for actually adding the item.
I think that's great
@gbowne1
Would clicking on Favorites in the dropdown/context menu there show all the favorited items?
whenever the user navigates to favorites through profile then the user is navigated to a different page where he can view only his favorites books .
We would have to figure out where to put a heart / favorite icon for actually adding the item.
how about before review and after year columns
sounds like a great idea.
@Gourav2609 it's been almost a month, have you been able to get through this issue? Just checking in to see if you have made any progress.
hello @gbowne1 ....sorry not able to update you about the progress...i just got a little busy with my college things...will update soon..
Ok, let me know. Am just checking in to see if you have made any progress.
@gbowne1 I would like to give this a go.
Ok @akash0708 I will assign you
@gbowne1 I have been facing this error since yesterday,
I've run script.js, created the test user. But I'm not being able to log in
the test user credentials are:
username: test email: test@gmail.com password test
Also: https://github.com/gbowne1/codebooker/blob/master/docs/DEVSETUP.md has more information, as well as the rest of this thread. If it still persists.. there might be other issues.. let us know.
@BlackBond06 @LOGESH-B
Hii @akash0708 Feel free to ask if you encountered any issue.🤝
Hey @gbowne1 , sorry I had my exams. But I'm finally done with them, and will start working on the issue right from today, will keep you updated. Thank you for your patience!
Some users may want to save books to their favorites.
May even have a side feature for users to share their favorite books with others.
I would suggest using a heart icon to:
1) add to favorite books list 2) show favorited books
Do we need to build a UI feature that will allow users to see their and/or possibly other users favorite books? My thoughts are yes.