#1 2014-11-24 10:23:42

mynotos
Member
Registered: 2014-11-24
Posts: 8

MongoDB FindDocs Method

Hello Community ,

i'm very happy to find the mormot Framework with MongoDB, its faster and easy to access. But i have one Problem with the FindDocs method

Coll.FindDocs('{kgs22:?}',['/^05314/'],res,null);

When i try to compile it gives me an error like

[DCC Fehler] Unit1.pas(242): E2250 Es gibt keine überladene Version von 'FindDocs', die man mit diesen Argumenten aufrufen kann

that there doest exist FindDocs method with this Arguments

if i look at source there are 2 overloaded functions with the same name , so normally it should not be the problem...

i tried also to seperate this 2 functions but this dont work too


may someone can have a hint or can help me ?=

Offline

#2 2014-11-24 12:40:04

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

Re: MongoDB FindDocs Method

Is res defined as TVariantDynArray ?

Please show some code to reproduce the issue.

Offline

#3 2014-11-24 13:13:13

mynotos
Member
Registered: 2014-11-24
Posts: 8

Re: MongoDB FindDocs Method

Oh you're right smile i dont use TVariantDynArray i used as Variant smile now its working fine  smile


other question is this result i want to store in a DataSet like TClientDataSet  from delphi

i used JSON

JSONToDataSet(ClientDataSet1,fValues);

do i need to do more ?

i cannot find an example in usage of this smile

Thanks in Advance

Offline

#4 2014-11-24 13:41:58

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

Re: MongoDB FindDocs Method

Up to now, the only solution was indeed to use JSONToDataSet().

But I just added TDocVariantArrayDataSet as read-only virtual TDataSet able to access a dynamic array of TDocVariant, e.g. to efficiently bind the result of TMongoCollection.FindDocs() to VCL UI.
See http://synopse.info/fossil/info/7a40ee7272
So you can now use an overloaded ToDataSet() function, which would take the result of TMongoCollection.FindDocs() as input.
It would avoid data transfer into JSON or any intermediate binary format, and retrieve the data rows directly from the dynamic array values.

Offline

Board footer

Powered by FluxBB