Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Couchbase Essentials

You're reading from  Couchbase Essentials

Product type Book
Published in Feb 2015
Publisher
ISBN-13 9781784394493
Pages 170 pages
Edition 1st Edition
Languages

A simple to-do schema


You've learned in previous chapters that schema design in the world of schema-less NoSQL databases tends to derive from the logical or object design of the application layer. As such, we'll start our application development efforts by considering the design of the classes we'll use in our application.

In the simplest case, a to-do app is nothing more than a checklist. To start modeling our schema, we'll limit the design to two properties of a checklist, namely a description and a checkbox. This design is shown in the following C# class:

public class Task
{
  public string Description { get; set; }
  public bool IsComplete { get; set; }
}

In this class, the Description property describes the task to be done. The Boolean property IsComplete simply checks whether the task has been completed. The corresponding JSON document stored in Couchbase mirrors this class:

{
  "description": "Pick up the almond milk",
  "isComplete": false
}

As we build our application, we'll add more...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}