Search:

Search all manuals
Search this manual
Manual
Couchbase Server Manual 1.8
Additional Resources
Community Wiki
Community Forums
Couchbase SDKs
Parent Section
9.2 Best practices
Chapter Sections
Chapters

9.2.4. Nested Items

You can store serialized, nested structures in Couchbase, such as by using encodings like JSON or XML (or Google Protocol Buffers or Thrift). A user profile item stored in Couchbase can then track information such as user interests. For example, in JSON:

{ "key": "user-1234", "handle": "bobama", "avatarURL": ...,
"interests": [ "A", "B", "X", "W" ], "groups": [ 1, 3, 5 ], ...
        }

If the above is stored in Couchbase under document ID "user-1234", you can then know the interests for that user by doing a simple GET for user-1234 and decoding the JSON response.