You can query CouchDB for documents by their ID, but of course, most of the time, you'll want to issue more complex queries, such as matching a field in a record against a particular value. CouchDB lets you define views of your data that consist of an arbitrary key in a collection of objects and then the objects derived from the view. When you specify a view, you're specifying two JavaScript functions: a map
function that maps keys to items in your collection, and then an optional reduce
function that iterates over the keys and values to create a final collection. In this recipe, we'll use the map function of a view to create an index of records by a single field.
JavaScript JSON Cookbook
By :
JavaScript JSON Cookbook
By:
Overview of this book
Table of Contents (17 chapters)
JavaScript JSON Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
Reading and Writing JSON on the Client
Reading and Writing JSON on the Server
Using JSON in Simple AJAX Applications
Using JSON in AJAX Applications with jQuery and AngularJS
Using JSON with MongoDB
Using JSON with CouchDB
Using JSON in a Type-safe Manner
Using JSON for Binary Data Transfer
Querying JSON with JSONPath and LINQ
JSON on Mobile Platforms
Index
Customer Reviews