I am working on a framework to save test data for QA test cases in mongodb. I want to save only 20 test data per api request. e.g. if api call is for member summary then I want to limit saving only 20 test datas and after 20 records no test data should be saved even if the api gets called.
is there any query for it?