The preceding BookStoreDatabaseSettings class is used to store the appsettings.json file's BookStoreDatabase property values. The following result is displayed: = null! If the database does exist, its connection is opened for transactions.Ĭreate a Books collection using following command: db.createCollection('Books') Run the following command in the command shell: use BookStoreĪ database named BookStore is created if it doesn't already exist. In the command shell connect to the default test database by running the following command: mongosh ![]() Open a MongoDB command shell instance by launching mongosh.exe. For more information on MongoDB Shell commands, see mongosh. Use the previously installed MongoDB Shell in the following steps to create a database, make collections, and store documents. Replace with the directory chosen in the previous step. In the OS command shell (not the MongoDB Shell), use the following command to connect to MongoDB on default port 27017. The mongo Shell doesn't create new directories. Create the directory if it doesn't exist. Add the resulting path for mongosh.exe to the PATH environment variable.Ĭhoose a directory on the development machine for storing the data. ![]() Add C:\Program Files\MongoDB\Server\\bin to the PATH environment variable.ĭownload the MongoDB Shell and choose a directory to extract it to. On Windows, MongoDB is installed at C:\Program Files\MongoDB by default.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |