I have some problems when using mORMot for function TMongoCollection.AggregateDoc.
When using $limit:1 in operators, one result is returned as variant. But how to obtain results in case
when using $limit:5. Se bellow an example:
var
doc: variant;
doc:= Coll.AggregateDoc('{$sort:{_id:-1}},{$limit:1}', []); ===> single value is returned, OK!
but
doc:= Coll.AggregateDoc('{$sort:{_id:-1}},{$limit:5}', []); ===> multiple values should be returned(5 values)?
Please, can you explain, how to retreive results from doc variable in second case (multiple values returned).
Hi!
I have some problems when using mORMot for function TMongoCollection.AggregateDoc. When using $limit:1 in operators, one result is returned as variant. But how to obtain results in case when using $limit:5. Se bellow an example: var doc: variant; doc:= Coll.AggregateDoc('{$sort:{_id:-1}},{$limit:1}', []); ===> single value is returned, OK! but doc:= Coll.AggregateDoc('{$sort:{_id:-1}},{$limit:5}', []); ===> multiple values should be returned(5 values)?
Please, can you explain, how to retreive results from doc variable in second case (multiple values returned).