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

Set up MongoDB data seeding #35

Merged
merged 4 commits into from
Mar 19, 2024
Merged

Set up MongoDB data seeding #35

merged 4 commits into from
Mar 19, 2024

Conversation

Ryii
Copy link
Contributor

@Ryii Ryii commented Mar 3, 2024

Notion Ticket Link

Setup Database Seeding

Implementation Description

  • Created two TypeScript scripts to seed user and entity data into MongoDB database.

Steps to Test

  1. Run npx ts-node backend/seeding/seedEntities.ts or npx ts-node backend/seeding/seedUsers.ts to create 10 random entities or users.
  2. Open a terminal and type mongosh mongodb+srv://cwc:[email protected]/ to connect to the database, then type db.users.find().sort([['_id', -1]] ) to check the latest entries.

What should reviewers focus on?

Screenshots (optional)

Checklist

  • My PR name is descriptive and in imperative tense
  • My commit messages are descriptive and in imperative tense. My commits are atomic and trivial commits are squashed or fixup'd into non-trivial commits
  • I have run the appropriate linter(s)
  • I have requested a review from the PL, as well as other devs who have background knowledge on this PR or who will be building on top of this PR

Linting & Formatting

Mac

docker exec -it CWC-backend /bin/bash -c "yarn fix"
docker exec -it CWC-frontend /bin/bash -c "yarn fix"

Windows

docker exec -it CWC-backend bash -c "yarn fix"
docker exec -it CWC-frontend bash -c "yarn fix"

backend/seeding/seedEntities.ts Outdated Show resolved Hide resolved
@owen-sellner owen-sellner merged commit db3b1de into main Mar 19, 2024
1 check failed
@owen-sellner owen-sellner deleted the seeding branch March 19, 2024 02:41
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

Successfully merging this pull request may close these issues.

2 participants