In couchbase : “eventTime”: “2022-04-14T19:40:00-07:00”,
From .net 3.2 SDK : “eventTime”:“2022-04-14T18:40:00-04:00”
Please check attached images. For same data in couchbase , getting differebt results from .net SDK2.7 and SDK3.2.8
Right side is with SDK 3.2 and left side with SDK 2.7
IBucketContext bucketContext = new BucketContext(await _getBucket());
return bucketContext.Query<Order>()
.ScanConsistency(ScanConsistency.RequestPlus);
Above code data returned in orderRequest and then filtered using following code orderEventData = orderRequest?.Where(oe => oe.PE == partner.Id
&& oe.References != null && oe.References.Any(x => x == shipmentReference))
?.OrderByDescending(e => e.DateCreated)
?.ToList();
Only if we try collection.GetAsync(documentId) its returning correct data. Even tried using N1QL quey but got same result as wrong datetime
Configuration in Startup.cs
Used this configuration
services.AddCouchbase(options =>
{
Configuration.GetSection(“Couchbase”).Bind(options);
options.AddLinq();
});
services.AddCouchbaseBucket(Configuration.GetValue(“CouchbaseStorageBucketName”));
Linq2Couchbase version
Linq2Couchbase Version=“2.0.0”
POCO POCO.zip (836 Bytes)
EventTime – This field is getting wrong data through SDK
I believe we have narrowed down this problem to a quirk in the Newtonsoft.Json deserializer that only affects the streaming deserializer we use for queries. We are working on a fix.
There seems to be a workaround available in the meantime. You can configure a custom instance of DefaultSerializer with custom options, and set DateParseHandling to DateTimeOffset. Alternatively, though somewhat more involved, you could switch to System.Text.Json serialization.
Thanks @btburnett3 , as per ticket its scheduled for 3.3.2. Current nuget version is 3.2.9 , by when can expect 3.3.2 available?
I tried with custom instance of DefaultSerializer with custom options but did not worked so will wait for SDK next version.
3.3.2 will be the next release, I’m assuming in the next few weeks but someone on the SDK team should be able to speak better to the current release cycle.
Can you give me the code you tried for a custom deserializer?