I have the following query,
// app.GAME_TYPE_BASIC => 1
var x = db.levels.where('type').equals(app.GAME_TYPE_BASIC);
return x.count();
The table setup can be seen below,
--------------------------
type | completed | level
--------------------------
using the above query there should be a count of 20. However in the console (where I am outputting) I get a object with all extra data.
What extra data? Are you using a promise to output the count in the console?
Below is part of it, it seems to me to be an error stack, however I checked the lines and nothing is occurring on those.
U {_listeners: Array[0], _lib: false, _PSD: Object, _stackHolder: Error
at S (http://127.0.0.1/www/assets/js/core/dexie.js:1:4608)
at new U (http://127…, _prev: U…}```
Line 6 is the return x.count();, so the query is failing?
Try this
var x = db.levels.where('type').equals(app.GAME_TYPE_BASIC);
return x.count().then (function(c){console.log (c)})
The count () call is async and you have to wait for it before calling console. In case you are already doing that then maybe you could post some more code to see if there could be other issues.
Most helpful comment
Try this
The count () call is async and you have to wait for it before calling console. In case you are already doing that then maybe you could post some more code to see if there could be other issues.