Chapter 3. Creating Secondary Indexes with Views
Now that we've examined Couchbase Server's key/value API, it's time to shift gears and look at its document-oriented features.
Couchbase documents
Documents in Couchbase are simply key/value pairs where the value is stored as a valid JSON document. The key/value API we learnt in Chapter 2, Using Couchbase CRUD Operations, is the same API we'll use to create JSON documents in the server. Generally, you'll use the client SDKs in combination with your platform's preferred JSON serializer, as shown in this C# snippet:
var user = new User { Name = "John" }; var json = JsonConvert.SerializeObject(user); bucket.Upsert("jsmith", json);
In this example, the popular .NET JSON serializer is used to transform an ...
Get Couchbase Essentials now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.