In SDK 1.3 we were capable of creating our own custom JSON string, storing it as a string and having Couchbase handle it as JSON. Is still possible with the .NET 2.0 SDK? It seems like the new generic methods will no longer allow this and basically handle the string as a string rather than JSON.
I am not sure I exactly understand what you mean, for example:
using (var bucket = _cluster.OpenBucket())
{
var jsonString = "{\"name\":\"bar\", \"age\":10}";
var insert = bucket.Upsert("JSON_KEY", jsonString);
Assert.IsTrue(insert.Success);
var get = bucket.Get<string>("JSON_KEY");
Assert.IsTrue(get.Success);
Assert.AreEqual(jsonString, get.Value);
}
This code creates a JSON string and stores it in Couchbase and then retrieves it comparing it to the original. If I look the key up in the Couchbase Admin Console, this is what I see:
Good to hear. Yes, the new SDK is a complete rewrite, so quite a bit has changed. Some things that were layered on top of the older SDK are embedded in the new SDK, JSON support is one of those things.