Hi,
I am having problems combining two where clauses:
I am trying to combine these clauses:
1.
var useridexpensevar = localStorage.getItem("useridexpense");
var whereObject = {"userprofid": {"$inQuery": {_id: useridexpensevar } //}};
return JSON.stringify(whereObject);
2.
var staridvar = localStorage.getItem("starid");
var whereObject = {"starid": {"$inQuery": {_id: staridvar } }};
return JSON.stringify(whereObject);
And this is what I have made:
var useridexpensevar = localStorage.getItem('useridexpense'), star = localStorage.getItem('starid');
var whereObject = {"userprofid": {"$inQuery": {id: useridexpensevar } } + {"starid": {"$inQuery": {id: star } } }};
return JSON.stringify(whereObject);
What is wrong with it? There are no JS issues int he console or any red flags when I put the code in.
Thanks