0

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?

1
  • You can use Change Streams to create such logic. But, change streams require that your deployment is a replica-set cluster (not a standalone deployment).
    – prasad_
    Commented Jun 12 at 9:21

0