(self, limit=20)
| 371 | print("error::DBDataFetcher.init>>", sys.exc_info()[1]) |
| 372 | |
| 373 | def dbFetcher(self, limit=20): |
| 374 | mainlist = [] |
| 375 | try: |
| 376 | records = self._collection.find().sort("id", -1).limit(limit) |
| 377 | for i in records: |
| 378 | del i["_id"] |
| 379 | mainlist.append(i) |
| 380 | except Exception as err: |
| 381 | print(f"exception : {err}\n") |
| 382 | print("error::dbFetcher>>", sys.exc_info()[1]) |
| 383 | finally: |
| 384 | return ujson.dumps(mainlist) |
| 385 | |
| 386 | def DBFetcherGreater(self, limit, date): |
| 387 | mainlist = [] |