Click here to Skip to main content
15,886,770 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i want to develop a travel booking website using MEAN stack development. Ticket booking can be done one month prior to the travel date. Today (30th July) i can book tickets till 30th august. Tomorrow i should be able to book tickets for 31st august. How to make it happen and how to make mongodb create a collection for upcoming days automatically ?

What I have tried:

I tried inserting collections into db for some set of days.
Posted
Updated 30-Jul-17 5:41am

1 solution

You don't have to worry about creating those collections; if you insert a document in a non-existing collection, MongoDB will automatically create a collection.

However if that's not sufficient because you need some special settings, use db.createCollection[^] to create the collection after figuring out if it already exists[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900