Update rethink queries

master
Big Bad Waffle 4 lat temu
rodzic
commit
6c345a72ba
1 zmienionych plików z 17 dodań i 0 usunięć
  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 => {


Ładowanie…
Anuluj
Zapisz