Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any plans on implementing the .all function? #257

Closed
djiordhan opened this issue Feb 20, 2017 · 3 comments
Closed

Is there any plans on implementing the .all function? #257

djiordhan opened this issue Feb 20, 2017 · 3 comments
Labels

Comments

@djiordhan
Copy link

djiordhan commented Feb 20, 2017

The express-session MemoryStore and Redis implements this, im just thinking this could be implemented here too.

We want to limit the concurrent sessions per user. I could just query all sessions from sessions collection but Im thinking if we could do it by implementing the .all function. Thanks

I already added this under my node_module and this works.

all(callback) { return this.collectionReady() .then(collection => collection.findAsync({ $or: [ { expires: { $exists: false } }, { expires: { $gt: new Date() } }, ] })) .asCallback(callback); }

@chuangl
Copy link

chuangl commented Mar 15, 2017

Thank you very much. I am a newcomer to this. I have 2 problems when I modify this.One is the 'findAsync is not defined', solution: I add find string in setCollection like this ['find'...].forEach(method...;
The other is findAsync return mongodb cursor in my situation, my solution is use cursor.toArray(),then return a new Array.
Any suggestion for me,Thanks

@IRETD
Copy link

IRETD commented Mar 24, 2017

Yes, it's a really necessary feature!

@stale
Copy link

stale bot commented Jun 11, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jun 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants