jaberbu / onfirework

Makes Firebase easy to use
Other
0 stars 0 forks source link

Filters: Combine queries (<, <=, >, >=) filter on different fields #19

Closed jaberbu closed 3 years ago

jaberbu commented 3 years ago

Now you have to make two queries and combine them

import * as _ from 'lodash';

const date_1 = await Onfirework.listDocs([['DATE_START', '>=', date]]);
const date_2 = await Onfirework.listDocs([['DATE_END', '<=', date]]);

const date = _.intersectionWith(date_1, date_2, _.isEqual);

The idea is that this combination is done directly in Onfirework function, abstracting the user and minify Query limitations

const date = await Onfirework.listDocs([ ['DATE_START', '>=', date], ['DATE_END', '<=', date] ]);
ezequieltejada commented 3 years ago

😯

ezequieltejada commented 3 years ago

@jaberbu Should this be done on the same Onfirework.listDocs method?