Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
dylan kane
2,772 PointsHaving a user add a destructible class to a mongo db... How should I approach this?
How can I have a user add something to database (mongo db) for as long as they need it. For example they would make a chat lobby, which would be added to a database of a bunch of peoples chat lobbies, and then once they were done using it, the database would delete it. Any help would be great, thanks!
1 Answer
Casey Ydenberg
15,622 PointsThe real question you're asking is how to express "done using it" in terms a computer can understand. How do you know when a user is done with it? When they say they are? When they close the page? If the chat lobby remains idle for X days?
There are tonne of tutorials on adding and removing records from Mongo; I suspect that's not what you're looking for ...