#1 2018-04-12 12:15:35

DigDiver
Member
Registered: 2013-04-29
Posts: 137

[suggestion] function TSQLRecord.FillOne proposal

In some cases, it would by nice to have an overload function TSQLRecord.FillOne(Options: TJSONToObjectOptions=[]);

The problem is that I try to connect to the mongoDB server with a "very old"  documents. At the moment not all fields in the collection are actual, but since the collection stores old values, I need to create too many dummy fields in my TSQLRecord class,
so adding  [j2oIgnoreUnknownProperty] to FillOne call would solve the problem. What do you think?

Last edited by DigDiver (2018-04-30 11:05:09)

Offline

#2 2018-04-30 11:06:10

DigDiver
Member
Registered: 2013-04-29
Posts: 137

Re: [suggestion] function TSQLRecord.FillOne proposal

Nobody needs?

Offline

#3 2018-04-30 12:32:21

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,669
Website

Re: [suggestion] function TSQLRecord.FillOne proposal

IIRC j2oIgnoreUnknownProperty has nothing to do with TSQLRecord ORM fields: it is about TDocVariant serialization.

What is the exact problem/exception raised with such an old DB?
I supposed old fields are just ignored by TSQLRecord.Fill.

Offline

#4 2018-05-02 12:59:57

DigDiver
Member
Registered: 2013-04-29
Posts: 137

Re: [suggestion] function TSQLRecord.FillOne proposal

ab wrote:

IIRC j2oIgnoreUnknownProperty has nothing to do with TSQLRecord ORM fields: it is about TDocVariant serialization.

What is the exact problem/exception raised with such an old DB?
I supposed old fields are just ignored by TSQLRecord.Fill.

The TSQLRecord.Fill does not ignored unknown fields and deserialization stops on unknown fields.

Offline

Board footer

Powered by FluxBB