#1 2019-11-21 22:53:37

fabiovip2019
Member
Registered: 2019-03-14
Posts: 76

Query with variant field

Is it possible with mormot to locate records in a mongodb collection across fields that are stored as variant?

Offline

#2 2019-11-22 07:56:24

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

Re: Query with variant field

Yes, you can use a variant value anywhere - see the doc.

Offline

#3 2019-11-22 12:19:03

fabiovip2019
Member
Registered: 2019-03-14
Posts: 76

Re: Query with variant field

Thanks Ab for the answer. What section of the doc is this information in? I found something on selfTest but accessing Tmongoclient directly and not using the mormot Framework.

In this collection:

 {"_id":{"$numberInt":"2"},"Name":"Fabio T de oliveira","Type":{"$numberInt":"0"},"DataPerson":{"CPF":"001.111.111-11","RG":""}} 

I can't select from the CPF field of the DataPerson object.

Offline

#4 2019-11-25 18:54:17

fabiovip2019
Member
Registered: 2019-03-14
Posts: 76

Re: Query with variant field

Hi ab,
I managed to do it using the finddocs method with direct access to a collection but I wonder if there is a way to do this at the ORM level. Using mormotDDD classes or even TSQLRecord?

Last edited by fabiovip2019 (2019-11-27 17:05:00)

Offline

Board footer

Powered by FluxBB