issues
search
include-davis
/
Include-CMS
In-house CMS system for future clients to use and deploy for free
MIT License
1
stars
1
forks
source link
API: findCollectionItems - lib
#32
Open
Austin2Shih
opened
6 months ago
Austin2Shih
commented
6 months ago
[ ] write async findCollectionItems(collection, query: object)
within _datalib/collections
return the following format: {ok: boolean, body: body || null, error: error || null}
Make default value of query to be null
Use try/catch and the custom Errors defined in _utils/response/Errors
Feel free to create new Error types if you see fit (following error code conventions for HTTP)
Call the MongoDB find function like usual even if query is null. If it's null then it will just return all so it's handled gracefully already.