Is it possible to return result into a single Array?

Oct 12, 2012 at 9:46 PM

I have two records in indexedDB

Group 1:

{"id":1,"contact":[{"id":1,"name":"Christopher"},{"id":2,"name":"Emmy"},{"id":3,"name":"Annick"}],"title":"group1"}

Group 2:

{"id":2,"contact":[{"id":4,"name":"Benoit"},{"id":5,"name":"Tom"}],"title":"group2"}

 

when i do :

db.linq.from("group").select().then(
        function(e) {
        }, null, function(data) {
             alert(JSON.stringify(data));
        })

it gives me two alert as there are two records, but i need the result to be a single array list(which contains the two records).  Is it possible to do it using linq2indexedDB?

Coordinator
Oct 14, 2012 at 11:22 AM

Hey,

Yes, that is possible. Instead of using the progress callback, use the complete.

db.linq.from("group").select.then(function(data){
     alert(JSON.stringify(data));
});

Oct 14, 2012 at 5:50 PM

Yup, it works like a charm.. thanks for your help :)