Details
-
Bug
-
Resolution: Fixed
-
Critical
-
4.0.0
-
Security Level: Public
-
None
-
8570 on ubuntu 12 with .net SDK 2.1
Description
high level flow----
- .net app: create a doc with expiry set to 5 mins.
- update the document with N1QL using update with the document key.
- read the document metadata from the .net app. the expiry and flags value is gone.
detailed code
.net app:
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using Couchbase.Core;
|
using Couchbase.Configuration;
|
using Couchbase;
|
using Couchbase.Configuration.Client;
|
using System.Configuration;
|
|
|
namespace ConsoleApplication4
|
{
|
class Program
|
{
|
static void Main(string[] args)
|
{
|
var config = new ClientConfiguration
|
{
|
Servers = new List<Uri> { new Uri("http://10.0.0.44:8091/pools") },
|
UseSsl = false,
|
DefaultOperationLifespan = 1000,
|
BucketConfigs = new Dictionary<string, BucketConfiguration>
|
{
|
{"default", new BucketConfiguration
|
{
|
BucketName = "default",
|
UseSsl = false,
|
Password = "",
|
DefaultOperationLifespan = 2000,
|
PoolConfiguration = new PoolConfiguration
|
{
|
MaxSize = 10,
|
MinSize = 5,
|
SendTimeout = 12000
|
}
|
}
|
}
|
}
|
};
|
|
Cluster cbCluster = new Cluster(config);
|
Document<object> cbDoc = new Document<dynamic> { Id = "01", Content = new { a="a", b=1}, Expiry=5*60*1000 };
|
using (var cbBucket = cbCluster.OpenBucket())
|
{
|
|
var upd = cbBucket.Upsert(cbDoc);
|
if (upd.Success)
|
{
|
Console.WriteLine("before N1ql update - Expiry:" + cbDoc.Expiry.ToString());
|
Console.ReadKey();
|
}
|
|
var get = cbBucket.GetDocument<dynamic>("01");
|
if (get.Success)
|
{
|
Console.WriteLine("after N1ql update - Expiry:" + get.Document.Expiry.ToString());
|
Console.ReadKey();
|
}
|
}
|
|
}
|
}
|
}
|
N1QL Queries:
run the following at the first readkey()
- verify the update is successful and the key exists:
select * from default use keys["01"]; - update statement to issue
update default use keys ["01"] SET a="a-updates" returning *;
Attachments
Issue Links
- is duplicated by
-
MB-16242 N1QL: we should be able to set the expiry in DML in the SET clause
- Closed
For Gerrit Dashboard: MB-15950 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
55088,1 | MB-15950: Implement GetMeta for gomemcached | master | gomemcached | Status: MERGED | +2 | +1 |
55089,4 | MB-15950: Add support for GetMeta | master | go-couchbase | Status: MERGED | +2 | +1 |