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

.all always pulls all the records #11

Open
ierceg opened this issue Jan 15, 2014 · 4 comments
Open

.all always pulls all the records #11

ierceg opened this issue Jan 15, 2014 · 4 comments

Comments

@ierceg
Copy link
Contributor

ierceg commented Jan 15, 2014

I'm having some issues with jugglingdb or the nano adapter inserting bogus data after retrieval so during the debugging I had to go through the implementation of all in the adapter. I was surprised that it pulls all the records onto the client and then filters them essentially using the database backend as a simple storage not as a proper database. I'm intending to fix this, if I can, but I was just wondering if this was some deliberate design choice or just an oversight?

@1602
Copy link
Contributor

1602 commented Jan 16, 2014

That's weird. Of course this is not how adapter should work. All what adapter should do is to translate query from jugglingdb abstraction to database abstraction. Adapter should not implement what already implemented in database. If you know how to deal with nano - feel free to amend implementation.

@ierceg
Copy link
Contributor Author

ierceg commented Jan 16, 2014

And jugglingdb's abstraction is to implement findOne in terms of adapter.all plus filtering, right?

I'll see what I can do.

@1602
Copy link
Contributor

1602 commented Jan 16, 2014

Yep. .findOne is like .all just with {limit: 1}, and .find is for lookup by
id.

On Thu, Jan 16, 2014 at 11:04 AM, Ivan Erceg [email protected]:

And jugglingdb's abstraction is to implement findOne in terms of
adapter.all plus filtering, right?

I'll see what I can do.


Reply to this email directly or view it on GitHubhttps://github.com//issues/11#issuecomment-32459673
.

Thanks,
Anatoliy Chakkaev

@Marak
Copy link

Marak commented Jun 21, 2014

+1

You will encounter performance issues with the current .all implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants