You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.
It doesn't seem to be possible to use sort or limit with botkit-storage-mongo because the exposed API does not accept options and pass them through to monk.
This means you can only ever retrieve all of the items in a collection that meet your query parameters and they will be returned in an order determined by Mongo.
This is less than ideal for many usecases.
I plan to submit a PR to address this, but am not sure whether you'd rather the exposed API become polymorphic and allow the options to be an optional second parameter, which I think the monk API supports, or if you'd prefer we break the convention of the monk API and add the options as an argument after the callback. Either of these options should be backwards compatible and not break any existing code that uses botkit-storage-mongo.
The text was updated successfully, but these errors were encountered:
And here's the relevant code from monk. It appears they use a polymorphic signature where the options arguments is optional. I'm working on a PR now that mirrors their approach.
It doesn't seem to be possible to use
sort
orlimit
withbotkit-storage-mongo
because the exposed API does not accept options and pass them through tomonk
.This means you can only ever retrieve all of the items in a collection that meet your query parameters and they will be returned in an order determined by Mongo.
This is less than ideal for many usecases.
I plan to submit a PR to address this, but am not sure whether you'd rather the exposed API become polymorphic and allow the
options
to be an optional second parameter, which I think themonk
API supports, or if you'd prefer we break the convention of themonk
API and add theoptions
as an argument after the callback. Either of these options should be backwards compatible and not break any existing code that usesbotkit-storage-mongo
.The text was updated successfully, but these errors were encountered: