-
Notifications
You must be signed in to change notification settings - Fork 0
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
Seed data #195
base: master
Are you sure you want to change the base?
Seed data #195
Conversation
Initial script used MongoClient to interface with MongoDB instead of Mongoose; this iteration will use mongoose to interface instead.
& cleanDB.py cleans up the collection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good for the most part, just the environment variable notes I mentioned in the comments may need changes. Besides that we should also think about data generation for listings in addition to users, but that can be moved to a different PR
|
||
#This is where the database gets seeded | ||
|
||
client = MongoClient("mongodb://vhomesgroup:[email protected]:27017,cluster0-shard-00-01.rmikc.mongodb.net:27017,cluster0-shard-00-02.rmikc.mongodb.net:27017/VHomes?ssl=true&replicaSet=atlas-1wcpgc-shard-0&authSource=admin&retryWrites=true&w=majority") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use the environment variables for this? The coordinates.py
file has an example of how to pull from the .env file https://github.com/staynomad/Nomad-Back/blob/master/tools/coordinates.py. We should do the same for the cleanDB.py
script
Relevant issue
Closes #140
Summary of change
Added seeder.py which inserts 100 documents with randomized user data into Staging/users collection.
Added cleanDB.py which clears the collection of previously seeded documents.
Testing/Verification
Tested it by running the script and then checking the collection.