Hello,From China, through Google Translate.May be inaccurate
bucket.MutateIn(“test”).WithExpiry(TimeSpan.FromSeconds(10)).Upsert(“a1”, “0000”, true)
Document expiration time is always 0,similar https://www.couchbase.com/forums/t/couchbase-java-subdocument-mutate-expiry/19486
I read the .net sdk source code.
Find CouchbaseBucket.cs
seems OptimizeSingleMutation method no setting Expires
I temporarily wrote Expires a value in SubDocDictUpsert,SubArrayAddUnique,SubArrayInsert,SubArrayPushFirst
public SubDocDictUpsert(MutateInBuilder<T> builder, string key, IVBucket vBucket, ITypeTranscoder transcoder, uint timeout)
: base(builder, key, vBucket, transcoder, SequenceGenerator.GetNext(), timeout)
{
CurrentSpec = builder.FirstSpec();
Path = CurrentSpec.Path;
Cas = builder.Cas;
Expires = builder.Expiry.ToTtl();
}
I don’t know if this is correct.
I hope to answer my question, thank you.
sdk version 2.7.2 ,Couchbase Server Enterprise Edition 6.0.0 build 1693