Hi all,
I’m working on upgrading our system from Couchbase 6 to Couchbase 8 and am running into an issue with it formatting date strings into an incompatible format.
If I run this query in the Couchbase query window
SELECT * FROM database USE KEYS “my_data”
I get something like this:
{
firstName: “John”,
lastName: “Doe”,
createdAt: “2025-12-31T20:14:35Z”
}
This is the date string that is stored in the database, and is the format that is needed. Executing this query from the Query window gives me the correct results.
However, if I execute this query in .Net:
var query = “SELECT * FROM database USE KEYS 'my_data'”;
var result = await cluster.QueryAsync<T>(query);
I get this:
{
firstName: “John”,
lastName: “Doe”,
createdAt: “2025-12-31T20:14:35+00:00”
}
It now sees that createdAt is a date and reformats it into a date string that is incompatible with our system. I never asked it to do this, and it is breaking our code in a lot of places.
This is something new with the most recent updates to the Couchbase SDK as the old system returned the dates simply as their original string.
Is there a way to configure the cluster so that it returns the string that’s stored in the database and doesn’t try to format it into a date? Or, at the very least, specify the format?
The data that our system stores is dynamic, so I can’t use anything in the query itself (like DATE_FORMAT_STR()). I need to set it at a system level.
Thanks for any help.