0

I've been searching trough dexie docs and here on stack but i can't find anything related. I'm new to dexie and it's the end of my work day, probably it's something that I didn't understand correctly (ー_ー)!!

This way it works:

DB['t_menus_' + langAbrev].where('menu_type', 'menu_group').equals('6', '3').toArray();

But this way won't work, why?

let theWhere = {menu_type: '6'};
theWhere['menu_group'] = '3';

DB['t_menus_' + langAbrev].where({menu_type: '6', menu_group: '3'}).toArray());
DB['t_menus_' + langAbrev].where(theWhere).toArray());

The error message: Uncaught TypeError: DB.t_menus_ptg.where(...).toArray is not a function

rantunes
  • 5
  • 3

1 Answers1

0

You need dexie >= 2.0 to use the latter format:

npm install dexie@^2.0.0-beta.11 --save

Or download from:

unpkg.com/dexie@^2.0.0-beta.11/dist/dexie.js

David Fahlander
  • 5,058
  • 1
  • 20
  • 19
  • I presumed I was using a "2 version" as I was using unpkg.com/dexie@latest/dist/dexie.js My bad, thanks for your help!! – rantunes Jul 07 '17 at 10:24