Book Image

ServiceStack 4 Cookbook

Book Image

ServiceStack 4 Cookbook

Overview of this book

Table of Contents (18 chapters)
ServiceStack 4 Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Using ServiceStack with MongoDB


Inarguably the most popular of the NoSQL databases, MongoDB is fast, reliable, commercially supported, enterprise friendly, and widely considered to be scalable in a web context. Perhaps the biggest secret to its popularity, however, is just how easy it is to get started. Unlike its cousin the Relational Database Management System (RDBMS), when using MongoDB, one can simply store an object as in a collection of objects—no normalization, no entity diagrams, and no formal object relational mapping is required.

MongoDB is in a family of NoSQL databases referred to as a document store. Document stores build on the foundations of a key-value store that simply allow a developer to retrieve values based on a key—document stores commonly add the ability to search through documents for a particular document. For instance, if we had a collection called inventory in our MongoDB database, we could search it for "snacks" items with the following simple query:

db.inventory...