Im having troubles trying to retrieve a large amount of data using Ydn-db.
The problem is:
-I have a large JSon file that I want to store in my app to use it offline
-I query the file and then save the data successfully using db.put
-Then, if I "print" the stored data using db.values
, I only get a portion of the text I previously saved.
You can also test it usign the Todo list demo given as an example here: http://dev.yathit.com/demo/ydn-db/todo.html
If you enter, lets say a 1MB text in the input, you wont get the whole text saved but just a fraction of it.
Is there a way to get around this issue?
Thanks!
EDIT: Here is a working example of what Im talking about http://flatic.com/test.html
EDIT 2: Ok, I think I found a temporary solution, it looks like YDN-DB can't store more than 100 Json objects so instead of saving my Json data directly like:
db.put('table',largeJsonData);
I first put the largeJsonData
as string inside a simple Json Array, something like this:
var data = {
"json":largeJsonData
};
db.put('table',data);
Now I can read the data doing:
db.values('table').done(function(items) {
console.log(items[0].json);
});
But you wont be able to make index search or get a specific value by any given Id