#1 Re: mORMot 1 » Updating record to mongoDB loses date format » 2016-09-23 08:15:04

Thanks for the reply.

I'll have a look at using DateToSQL().

#2 mORMot 1 » Updating record to mongoDB loses date format » 2016-09-22 09:12:23

MrFresh
Replies: 2

Hello,

I'm having issues updating a record to mongo using mORMot.

- Application loads data from mongoDB in to a variant.

- Makes some modifications.

- Writes the data back to the DB.

The problem is that after the update the various date fields within the record (which haven't been modified in the app), are no longer recognised as date types - they are strings.

We fixed this issue during import, using this:

var
  data : variant;
  buffer : string;

...
data       := _JSon(RawUTF8(buffer), [dvoJSONParseDoNotTryCustomVariants]);
...

But it doesn't appear to work when writing back to the DB.

Any help would be appreciated!

Thanks!

Board footer

Powered by FluxBB