Closed brailateo closed 10 years ago
I had to patch db.js here ...
var desc = function () {
direction = 'prev';
return {
keys: keys,
execute: execute,
filter: filter,
distinct: distinct,
modify: modify,
limit: limit,
map: map
};
};
introducing limit in return object and call it like that
IDBS.query( 'owners', 'version' )
.all()
.desc()
.limit(1)
.execute()
.then( function ( rezQuery ) {
console.log('rezQuery ',rezQuery);
} );
in order to make it work!
send a PR and I'll get it merged
Date: Tue, 14 Oct 2014 05:58:26 -0700 From: notifications@github.com To: db.js@noreply.github.com Subject: Re: [db.js] Wrong Limit syntax ? (#92)
I had to patch db.js here ...
var desc = function () { direction = 'prev'; return { keys: keys, execute: execute, filter: filter, distinct: distinct, modify: modify, limit: limit, map: map }; };
introducing limit in return object and call it like that
IDBS.query( 'owners', 'version' ) .all() .desc() .limit(1) .execute() .then( function ( rezQuery ) { console.log('rezQuery ',rezQuery); } );
in order to make it work!
— Reply to this email directly or view it on GitHub. =
Oups! :-( I'm an old-style-svn-guy, didn't even tried to know what's PR/git so ... just drop this line
limit: limit,
after line 398 in current db.js source and everything is ok! "desc" function member does not propagate properly the "limit" function Thanks, Teo
Got latest db.js and https://es6-promises.s3.amazonaws.com/es6-promise-2.0.0.js , patched Promise with something like that:
In Firefox ( 32 , native Promise ) I get: TypeError: IDBS.query(...).desc is not a function Wrong syntax? An example in the main readme.md would be just perfect!