ydn-db

YDN-DB How to verify if a record exists?

╄→尐↘猪︶ㄣ 提交于 2020-01-05 09:05:26
问题 I'm trying to verify if a specific record exist inside a table by a given ID. For example: var id = 23; db.count('products',id).done(function(count) { if(count>0){ db.get('products',id).done(function(r) { //Do something }); }else{ alert('No product found'); } }); When I try this, I get the following error: uncaught exception: null I'd really appreciate your help Thanks!. 回答1: Your solution is almost correct. In IndexedDB API, there is no exists method, probably because it can be emulated

Most efficient way to populate/distribute indexedDB [datastore] with 350000 records

落花浮王杯 提交于 2019-12-23 19:15:03
问题 So, I have a main indexedDB objectstore with around 30.000 records on which I have to run full text search queries. Doing this with the ydn fts plugin this generates a second objectstore with around 300.000 records. Now, as generating this 'index' datastore takes quite long I figured it had be faster to distribute the content of the index as well. This in turn generated a zip file of around 7MB which after decompressing on the client side gives more than 40MB of data. Currently I loop over

Safari shows indexed column undefined on indexeddb polyfill. How to retrieve data using indexes in safari

醉酒当歌 提交于 2019-12-23 03:17:48
问题 I m getting the index colums on safari as undefined Here is the snippet i ve written. I am using parshurams indexeddb and shim jquery plugin. .indexedDB("database_name", { "schema" : "1" : function(transaction){ // Examples of using the transaction object var obj2 = transaction.createObjectStore("store2",{"keyPath":"index"}); obj2.createIndex("price"); } } }); var sampledata={ index:'1', firstName: 'Aaron', lastName: 'Powell', answer: 42, price:100 }; var randomnumber=Math.floor(Math.random()

Most efficient way to query ydn-db in a joining way

孤街浪徒 提交于 2019-12-13 07:46:40
问题 Setup I got stores called ' mapNodes01 ', ' mapNodes02 ', ..., ' mapNodes70 ' Each holds a number of nodeIDs (keyPath nodeID ) I got another store called 'data' that holds values for all available nodeIDs (keyPath nodeID ) It is setup like this because the mapNode stores hold different overlapping combinations of nodeIDs. Storing the values of the data store to each mapNode store would be ugly since i need to download and refresh the data table every hour (~7000 nodes). Question SELECT * FROM

Querying on multiple keys (range on one of them) with indexedb or ydn

喜夏-厌秋 提交于 2019-12-11 08:23:33
问题 I have read, re-read and read again this document and countless of other sites, but for the life of me I am unable to figure out how to do the following. I simply have the following (ydn notation) { name:'index', keyPath:['int1','int2','int3'], unique:false, multiEntry:false } And want to run a query along the lines of int1=a and int2=b and int3>c and int3<d Which I believe should be simple enough and if it's not possible in ydn (or too hard) I am fine with a pure indexedDB solution as well

YDN-DB with multiple deferred

隐身守侯 提交于 2019-12-11 07:43:42
问题 Im trying to use multiple deferred with jquery $.when but so far no luck, this is my code: var req = $.when(db.count('items'),db.values('items'),db.get('config', 1)); req.done(function(count,r,config) { var currency = config.currency; if(count > 0){ var n = r.length; for (var i = 0; i < n; i++) { var id = r[i].id; var itemId = r[i].itemId; console.log('ID: '+id+' itemID: '+itemId+' Currency: '+currency); } } }); My sample isn't working so hope you guys can help me, I searched everywhere for a

YDN DB Include issue

老子叫甜甜 提交于 2019-12-10 15:45:40
问题 I have included YDN DB file (ydn-db-isw-core-crypt-qry-dev.js) to encrypt Index DB in angular app.It's added in index.html body section after socket.io-1.4.5.js,a loader spinner.head section includes plivo.min.js library- <script type="text/javascript" src="./assets/ydnCoreCryptQryDev.js"></script> Earlier i was using plain IndexDB and things were going well.But the collection details were visible in developer tools. Now after including YDN DB,It just keeps loading homepage after setting user

YDN-DB - Incorrect results using mixed data types with SortedMerge

拈花ヽ惹草 提交于 2019-11-28 02:23:19
I'm using the excellent YDN-DB as part of a complicated 'dashboard' web page that allows a user to download a large amount of information and then search & filter the data how they wish. The data comes down in the form of 1 UNID and 6 columns of visible data which I am storing using a YDN schema like this: var schema = { stores: [ { name: 'test', keyPath: 'unid', autoIncrement: false, indexes: [ {keyPath: 'a', type: 'TEXT'}, {keyPath: 'b', type: 'TEXT'}, {keyPath: 'c', type: 'TEXT'}, {keyPath: 'd', type: 'DATE'}, {keyPath: 'e', type: 'TEXT'}, {keyPath: 'f', type: 'TEXT'} ] } ] }; The user then

YDN-DB - Incorrect results using mixed data types with SortedMerge

送分小仙女□ 提交于 2019-11-26 23:40:18
问题 I'm using the excellent YDN-DB as part of a complicated 'dashboard' web page that allows a user to download a large amount of information and then search & filter the data how they wish. The data comes down in the form of 1 UNID and 6 columns of visible data which I am storing using a YDN schema like this: var schema = { stores: [ { name: 'test', keyPath: 'unid', autoIncrement: false, indexes: [ {keyPath: 'a', type: 'TEXT'}, {keyPath: 'b', type: 'TEXT'}, {keyPath: 'c', type: 'TEXT'}, {keyPath