Chapter 4. Creating Models
In this chapter, we will cover the following topics:
- Implementing a simple collection
- Using the Session object
- Sorting with MongoDB queries
- Filtering with MongoDB queries
- Creating upsert MongoDB queries
- Implementing a partial collection
Introduction
The Meteor data model is designed to be very easy to develop. Gone are the days of worrying about lengthy SQL statements, database drivers, and rigidly structured database tables. In its place is a straightforward, JSON-based document model that lets you focus on the functionality of your application. This chapter contains the most common recipes to interact with MongoDB and the reactive model context inside Meteor.
Implementing a simple collection
Collections are the medium of communication between the client and the server, with changes being pushed down to the client and requests being pushed up to the server. This recipe will show you how and where to declare a collection for use on both the client and the server...