Nest document data NoSQL


show more Nesting document data provides you with in-depth training on Developer. Taught by Joseph LeBlanc as part of the Up and Running with NoSQL Databases show less
please wait ...

Nesting document data

Flat fields are just one of the many options you have for storing data in CouchDB. Arrays and objects allow you to nest data within documents. Right now, we have the Futon interface loaded with the restaurant database in place. So let's navigate to restaurant. We already have a couple of documents ready to go. Click on the one with the second revision. Here we have the document with the hours. Let's say we want to add the hours as an object where we can more readily access that data in a structured format.

Let's go to the exercise files to paste that in. Copy this object, and then create a new field for it by clicking Add Field. I'm going to call this field Hours, and now I am going to paste that data into this field, and then click the green check. You'll notice now we have each day of the week bolded, and the value is in quotes.

If we click over to the source, you'll see that hours is structured within this document. One thing that's very important...

Nesting document data
Video duration: 3m 12s 56m 57s Intermediate

Viewers:

Nesting document data provides you with in-depth training on Developer. Taught by Joseph LeBlanc as part of the Up and Running with NoSQL Databases

please wait ...