Reputation: 365
I am using ydn-db as the plugin
I have defined indexes (secondary key) and I want to check if I have any data matching for that index.
suppose I have column3 as the index and I have the value "1001" Is there a way I can get a count/data or something if column3 has the value 1001 in it?
Upvotes: 0
Views: 103
Reputation: 13131
It should be as simple as:
var kr = ydn.db.KeyRange.only(1001);
db.count('store name', 'index name', kr)
Or using newer syntax:
db.from('store name').where('index name', '=', 1001).count().done(...
Upvotes: 1