howdyai / botkit-storage-mongo

A MongoDB storage driver for Botkit
MIT License
54 stars 42 forks source link

Add a Find method to get filtered results instead of all #18

Closed oiorain closed 7 years ago

oiorain commented 7 years ago

Hi!

I thought it would be useful to have a find method to be able to select a set of results from the DB instead of the all. It's useful when handling multiples team bots and getting the all users for a specific team but there are many other use cases I think.

I also added some documentation for this new method along with precisions on how to use the get and all method. It wasn't clear to me from the start and I had to look at the sources so it might be useful to others. I took the liberty to correct the get method especially since it works with a callback and doesn't return the user.

Cheers!

benbrown commented 7 years ago

Thanks for the contribution, @oiorain! Sorry it took so long to merge :)