Exemplo n.º 1
0
        public string Couchbase_UpsertMultiple()
        {
            var bucket     = _connection.Bucket;
            var testobject = new CouchbaseTestObject()
            {
                Name = "New Relic"
            };

            var documentDictionary = new Dictionary <string, CouchbaseTestObject>()
            {
                { "Couchbase_UpsertMultiple_1", testobject },
                { "Couchbase_UpsertMultiple_2", testobject }
            };

            var result = bucket.Upsert(documentDictionary);

            return(result.Count.ToString());
        }
Exemplo n.º 2
0
        public string Couchbase_UpsertMultipleParallelOptionsWithRangeSize()
        {
            var bucket     = _connection.Bucket;
            var testobject = new CouchbaseTestObject()
            {
                Name = "New Relic"
            };

            var documentDictionary = new Dictionary <string, CouchbaseTestObject>()
            {
                { "Couchbase_UpsertMultipleParallelOptionsWithRangeSize_1", testobject },
                { "Couchbase_UpsertMultipleParallelOptionsWithRangeSize_2", testobject }
            };

            var result = bucket.Upsert(documentDictionary, new ParallelOptions()
            {
                CancellationToken = CancellationToken.None, MaxDegreeOfParallelism = 4, TaskScheduler = TaskScheduler.Current
            }, 10);

            return(result.Count.ToString());
        }