What’s in a Name?
With the release of Couchbase Server 1.8, both the server and client libraries are getting a number of bug fixes. But the change that will mean the most to long time users is the new name. Membase Server is now Couchbase Server and the Membase .NET Client Library is now the Couchbase .NET Client Library. This refactoring isn’t like renaming your AccountManager class to AccountService, it goes beyond that.
Getting the Client
There are a couple of ways to get the Couchbase .NET Client Library, or simply “the client.” The easiest way, is use 누오겟, the .NET package manager for Visual Studio. You can get the Couchbase Nuget package by opening the Package Manager Console under View -> Other Windows and typing:
Install–Package CouchbaseNetClient
A second option is to download a zip file with the assembly and dependencies. You can also grab the latest source from 깃허브. See the notes readme.mdown to build from the source.
Hello, Couchbase!
Checkout the client’s home page for a walkthrough on how to get started with the client. The API documentation provides sample code for the primary methods you’ll use when working with the client. The snippets below give you the basics of the client.
//standard app.config settings may also be used
var config = 새로운 CouchbaseClientConfiguration { 양동이 = “default” };
설정.Urls.Add(새로운 Uri(“https://127.0.0.1:8091/pools/default”));var beer = 새로운 Beer { 이름 = “Atlantic Amber”, Brewery = “New England Brewing Co.” }
var client = 새로운 CouchbaseClient(설정);
client.Store(StoreMode.Add, “beer_12345”, beer);
var savedBeer = client.Get<Beer<(“beer_12345”);
Breaking Changes
With the product name change comes a new name for the client. This update means that your code that used to look like:
var client = 새로운 MembaseClient();
now looks like:
var client = 새로운 CouchbaseClient();
The config section has changed as well.
Looking Forward
Couchbase Server 1.8 and the .NET Client Library 1.0 are only a few hours old (well, they’ve only been released for a few hours), but we’re already thinking about Couchbase Server 2.0 and the new client libraries. So keep an eye on this blog for the latest samples and information.
작가
2개의 응답
-
What we (API consumers) need is a client API that allows for querying against the elements and attributes of the design doc. Key/Value lookups only get you so far and require hacky solutions to problems like lists of sub elements.
-
[…] his blog, John Zablocki introduces the new .NET SDK, while Rags Srinivas covers the updates in both the Java and Ruby SDKs. Our own Jan Lehnardt also […]

댓글 남기기
댓글을 달기 위해서는 로그인해야합니다.