-
Notifications
You must be signed in to change notification settings - Fork 12
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
(daleharvey/pouchdb#1199) - query() supports keys (rebased on #9) #11
Conversation
#9 is awesome by the way; thank you for setting it up so we can test both at the same time. |
I am still getting the same 2 errors |
Hm, that's super weird. TBH I never actually saw those two errors you mentioned in #8, and 1c78760 works fine for me. I do What version of Node are you running? I'm on Node 0.10.12, but I will try 0.10.24 and 0.11. In case it's not that, my other system details are: OS X Mountain Lion 10.8.5, CouchDB 1.5.0, LevelDB 1.14.0. |
I can't get leveldown to build in Node 0.11.0, but 0.10.24 works fine. |
Tried it on a fresh Linux installation and it works there as well (crunchbang, node 0.10.24). Your errors seem to pop up because Also, sorry for not being forthright before about not seeing your errors; I thought they were related to the key+docid sorting problem, but it looks like that's an orthogonal issue. |
Oh, I think this is my fault , I bet I'm testing against version 1.0.0.
|
yeah it's testing against a really old version of pouch, which leaves us with only one error, which is related to the way errors changed in pouch this line should have the keys 'error' and 'reason' changed to 'name' and 'message'. if you change that, then change this line to err.name (along with switching the dev depencency of pouch to ~1.1.0 from 0.1.6 we should be all set |
The query() function now supports keys as an input param. Keys are hashed in advance, to ensure that the complexity is O(n) rather than O(n * m), where n is numDocs and m is numKeys. Since there are a lot of edge cases for null/undefined/etc., I'm also adding unit tests to daleharvey/pouchdb, which confirm that the functionality is exactly like CouchDB's.
OK, we should be good to go now. Also had to change these lines. |
merged |
The query() function now supports keys as an input param.
Keys are hashed in advance, to ensure that the complexity
is O(n) rather than O(n * m), where n is numDocs and m
is numKeys.
Since there are a lot of edge cases for null/undefined/etc.,
I'm also adding unit tests to daleharvey/pouchdb, which
confirm that the functionality is exactly like CouchDB's.