Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

sorting and limiting data in mongo db query tool in soatest?

sohail611710
sohail611710 Posts: 3

How to sort and limit data in mongo db query tool in soatest?

Answers

  • benken_parasoft
    benken_parasoft Posts: 1,306 ✭✭✭
    edited May 2018

    There is no specific option in the MongoDB Query Tool to sort or limit the documents that are returned from executing the query. The tool could perhaps be enhanced to have something like this, since I do see both sort and limit methods in their client api. You would have to make a formal enhancement request to your Parasoft technical account representative.

    However, there are always other ways to accomplish things, where you could sort the results outside the MongoDB Query Tool with something else. For example, you could chain an XML Converter and XML Sort tool or you could sort the results yourself with a custom script from an Extension tool.

  • sohail611710
    sohail611710 Posts: 3

    Actually collcetion has more than 60000 records... So we are not sble retrieve the data.. as it throws java heap error.
    And about client api... we dont have access to add or delete from ctp(soatest server)...

  • benken_parasoft
    benken_parasoft Posts: 1,306 ✭✭✭

    Just so you know, I was referring to the MongoDB Client Java API, not CTP or SOAtest REST APIs. This is the Java API used internally by the MongoDB Query Tool. The reason I pointed this out was to make the point that what you are asking happens to be natively supported by the MongoDB Client. Therefore, requesting such an enhancement to the MongoDB Query Tool seems very reasonable. I highly recommend that you contact your Parasoft technical account representative and make a formal feature request.

    For now, the only other alternative I can recommend would be to write a custom script to perform this particular query. If you were to use the MongoDB Client API from your own script, you can programmatically set the limit and sort.

  • benken_parasoft
    benken_parasoft Posts: 1,306 ✭✭✭

    The new MongoDB Tool supports find, insert, update, and delete. It also now supports sort, skip and limit for query results.