When i run a aggregate method of the driver i get a AggregateIterableImpl
How to get the same using runCommand({“aggregate” …})
Or with any command that returns cursor like “find” etc
I want to convert runCommand that return a cursor document ,to a Java driver cursor.
Its important because without we cant run any command that return cursor.
I am looking for how the java driver does it in code,but i haven’t found it.
There is no way to do this with the public driver API. Can you explain your use case, and what prevents you from using the existing helper method for aggregate?
There is no way to do it with the current public API of the driver.
I’m still not clear from your description why you need to generate the full command document. Your best bet is to generate just the aggregation pipeline and use the driver’s existing aggregate helper.
Thank you for the reply,i will go for the pipeline only,the big part is the pipeline,i was thinking that also now.
But in general i believe it would be useful,to have it,commands are the same in all drivers,
and it would be helpfull to be able to run them all with runCommand