This project has moved. For the latest updates, please go here.

is it possible to retrieve and filter the array of an array?

Oct 12, 2012 at 9:52 PM
Edited Oct 12, 2012 at 9:56 PM

I have a record in indexedDB:




is it possible to retrieve and filter the array of an array using linq2indexedDB?

in my example, i want to retrieve only the contact having -> {"id":2,"name":"Emmy"}

Oct 14, 2012 at 11:20 AM

Try the following:

db.linq.from("objectstore").where("").equals(2).select(["", ""]);

Oct 14, 2012 at 5:49 PM

it does not work.. the output is: []

and when i tried without the where condition :

db.linq.from("group").select(["", ""]).then(function(data){

i hv got this : [{"contact":{}}]

Here is the test that i tried:

//Structure of contact
function ContactVO(){ =0;;

//Structure of group
function GroupVO(){ = 0; new Array();

//Create contact 1
var c1 = new ContactVO();;'Christopher';

//Create contact 2
var c2 = new ContactVO();;'Emmy';

//Create contact 3
var c3 = new ContactVO();;'Annick';

var g1 = new GroupVO();;

var contacts = new Array();
contacts.push(c3); = contacts;  //a group can contain many contacts, for this example, there are three contacts

 var db = $.linq2indexedDB("group", null, true);

Any idea?

Oct 17, 2012 at 7:07 AM

I don't know if it was a typo or not, but when you insert you insert d1 which isn't defined.

Nov 2, 2012 at 8:59 PM
Edited Nov 2, 2012 at 9:07 PM

Sorry, it s not d1, but g1

The solution that i have found is to use  "filter" for the array contact


data[0].contact.filter(function (e) {


Anyway, thanks for your help