-
Notifications
You must be signed in to change notification settings - Fork 12
Conversation
query limit and offset will simply work by using the child query to filter out the sharding special keys.
After sorting, the key names need to be converted back.
package.json
Outdated
@@ -52,6 +52,7 @@ | |||
}, | |||
"contributors": [ | |||
"David Dias <daviddias.p@gmail.com>", | |||
"Friedel Ziegelmayer <dignifiedquire@gmail.com>" | |||
"Friedel Ziegelmayer <dignifiedquire@gmail.com>", | |||
"Richard Schneider <makaretu@gmail.com>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to do this manually these lists are generated on release
src/sharding.js
Outdated
f(Object.assign({}, e, { | ||
key: this._invertKey(e.key) | ||
}), cb) | ||
}) | ||
tq.filters.push(...filters) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...
is not available in node@4, not sure if we dropped that yet, cc @diasdavid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, will downgrade
@dignifiedquire Could you look at the build? Getting errors from Good news is that lint and all tests pass. |
Now that we are building on windows, we need PR ipfs/interface-datastore#12. Any idea on when it will be approved and released to NPM? |
src/sharding.js
Outdated
@@ -128,52 +127,45 @@ class ShardingDatastore { | |||
} | |||
|
|||
query (q /* : Query<Buffer> */) /* : QueryResult<Buffer> */ { | |||
const tq/* : Query<Buffer> */ = { | |||
keysOnly: q.keysOnly | |||
let tq/* : Query<Buffer> */ = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/let/const/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit old-school, I use const when the object won't change; which is the JS usage..
src/sharding.js
Outdated
} | ||
|
||
if (q.filters != null) { | ||
tq.filters = q.filters.map((f) => (e, cb) => { | ||
let filters = q.filters.map((f) => (e, cb) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/let/const/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got me, consistency is the hobglobin of little minds!
I'll make both changes
Fixes
sharding.query
. Allinterface-datastore
tests now pass.