Book Image

Learning Node.js for Mobile Application Development

Book Image

Learning Node.js for Mobile Application Development

Overview of this book

Table of Contents (21 chapters)
Learning Node.js for Mobile Application Development
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
14
Creating an E-Commerce Application Using the Ionic Framework
Index

Creating a database


Let's start by defining the database that we are going to work with. In your shell, execute the following:

> use OrderBase

This will ask MongoDB to switch to a new database, called OrderBase, that we wish to run the commands against. The response will be as follows:

switched to db OrderBase

But wait, how can we switch to a database that does not exist yet? MongoDB flexibility to the rescue! When you tell MongoDB to use a database, it will create that database for you automatically before switching to it.