Update rethink queries

master
Big Bad Waffle 4 年之前
父節點
當前提交
6c345a72ba
共有 1 個文件被更改,包括 17 次插入0 次删除
  1. +17
    -0
      rethink-queries.md

+ 17
- 0
rethink-queries.md

@@ -50,6 +50,23 @@ r.db('live').table('character')
});
});

//Find all accounts with more than 1 Smoldering Idol in their stash
r.db('live').table('stash')
.filter(row => {
return row('value').ne(null).and(row('value').typeOf().eq('ARRAY'));
})
.concatMap(row => {
return [{
name: row('id'),
cpn: row('value').filter(item => {
return item('name').eq('Smoldering Idol').and(item('quantity').gt(1));
})
}];
})
.filter(c => {
return c('cpn').count().ge(1);
});

//Play time per account from low to high
r.db('live').table('character')
.concatMap(row => {


Loading…
取消
儲存