background preloader

MONGO

Facebook Twitter

Getting Started with MongoLab: Part 2 | | CloudSpringCloudSpring. In the first article about MongoLab, I showed you how to get set up with MongoDB for local development, and MongoLab, the PaaS service built specifically to handle remote deployments of a MongoDB database. In this article I am going to show you how to work seamlessly with MongoLab to continue building a simple PHP app that uses a MongoDB database hosted on MongoLab. I am also going to show you a better way to connect to MongoLab from your own computer. It eliminates the need for a local instance of MongoDB to be running at all. Improved connection to MongoDB There seems to be an issue with MongDB where the default connection parameters are set for localhost. Changing the installation process on your own machine for MongoDB solves the problem. Once you have HomeBrew installed, it is simply a matter of running: from the terminal app.

What about Windows users? The recommended way to install MongoDB for Windows is via the pre-built binaries. I’m on Linux, what do I do? Connecting to MongoLab. MongoDB. O'Reilly Webcast: MongoDB Schema Design: How to Think Non-Relational. PHP Master | Modeling Data Relationships in MongoDB. It’s important to consider the data needs of your application right from the very start of development. But if your app will be using NoSQL and you come from a RDBMS/SQL background, then you might think looking at data in terms of NoSQL might be difficult. This article will help you by showing you how some of the basic data modeling concepts apply in the realm of NoSQL. I’ll be using MongoDB for our discussion as it is one of the leading open-source NoSQL databases due to its simplicity, performance, scalability, and active user base. Of course the article assumes that you are aware of basic MongoDB concepts (like collections and documents).

If not, I suggest you read some of the previous articles here at SitePoint to get started with MongoDB. Understanding Relationships Relationships show how your MongoDB documents are related to each other. 1-to-1 Relationship (1:1) A 1:1 relationship exists when one object of an entity is related to one and only one object of another entity.

Conclusion. Schema Design - MongoDB. Data Models¶ Data in MongoDB has a flexible schema. Collections do not enforce document structure. This flexibility gives you data-modeling choices to match your application and its performance requirements. Read the Data Modeling Introduction document for a high level introduction to data modeling, and proceed to the documents in the Data Modeling Concepts section for additional documentation of the data model design process. The Data Model Examples and Patterns documents provide examples of different data models. You can download this section in PDF form as Data Model Design for MongoDB. Data Modeling Introduction An introduction to data modeling in MongoDB.

Data Modeling Concepts The core documentation detailing the decisions you must make when determining a data model, and discussing considerations that should be taken into account. Data Model Examples and Patterns Examples of possible data models that you can use to structure your MongoDB documents. Data Model Reference Report a Problem.