0

I am developing an web app. Therefore I use Sencha Touch 2 and for ydn db for local storage.

My question is, how can I fetch data from ydn db by 2 or more conditions? For example username=Moo and street = Teststreet and lastname = 'xy'?

Thanks for replies. :-)

4

2 回答 2

2

这是我如何使用 scan() 但希望 .where().where() 将很快实现。

var iters, key_range, result, solver;

iters = [];

key_range = ydn.db.KeyRange.only(18);
iters.push(new ydn.db.IndexIterator('person', 'age', key_range));

key_range = ydn.db.KeyRange.only('F');
iters.push(new ydn.db.IndexIterator('person', 'sex', key_range));

result = [];
solver = new ydn.db.algo.NestedLoop(result);    
db.scan(solver, iters).then(function() {
    console.log(result);
});

我基于这里的示例https://github.com/yathit/ydn-db/blob/master/test/qunit/cursor.js#L929-L943

希望有帮助。

于 2014-07-26T09:56:00.983 回答
0

阅读此文档。目前这并不容易。

于 2014-02-20T13:28:37.497 回答