Skip to content

Instantly share code, notes, and snippets.

@MikeGoldsmith
Last active September 29, 2017 09:29
Show Gist options
  • Save MikeGoldsmith/52be8eec96a3115d73d5ff74618aba80 to your computer and use it in GitHub Desktop.
Save MikeGoldsmith/52be8eec96a3115d73d5ff74618aba80 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using Couchbase;
using Couchbase.Authentication;
using Couchbase.Configuration.Client;
namespace memcached_example
{
class Program
{
static void Main(string[] args)
{
var configuration = new ClientConfiguration
{
Servers = new List<Uri> {new Uri("http://10.112.163.101:8091/pools")}
};
using (var cluster = new Cluster(configuration))
{
cluster.Authenticate(new ClusterCredentials
{
BucketCredentials =
{
{"MOTK-User", "<password>"},
{"MOTK-UserSession", "<password>"}
}
});
var bucket = cluster.OpenBucket("MOTK-User");
bucket.Upsert("my-key", new { });
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment