Search code examples
mongodbmongodb-queryphp-mongodbdatabase

Creating Database in MongoDB and Inserting data from file


I just configured Mongo Db on my system. What is the difference between collection and Database in Mongo DB, I did db.help() to see different functions. But I couldn't find any function to add create db,create table or column etc I have a csv file that i want to load in Mongo DB. Please help Thanks


Solution

  • In MongoDB you don't have to specifically create the database or collections. Just by calling one will create it if it's not available. You also don't create columns like you do in SQL, fields are dynamic and you can have many different fields in your documents. As for importing a csv, take a look here