Closed girishawate closed 8 years ago
@girishawate Apologies for the delay, but looking into this.
Did you manage to arrest the issue..
Let me know if you need any more clarity on the same .. regards
Yeah, it's a bug (triggered by the spaces in the strings). Will issue a fix.
Hi ! Did you manage to get the fix .. Can you help with a workaround if any ..
@girishawate sorry for the confusion. I misjudged it as a bug earlier, but in fact, it's not. I was unable to reproduce the problem. I ran this sample and got 1 row back as expected.
lib.createTable("prodlist", ["pName", "pLocalName", "pImage2"]);
lib.insert("prodlist", {pName: "Orange small", pLocalName: "Orange small", pImage2: "org.jpg"});
lib.insert("prodlist", {pName: "Orange large", pLocalName: "Orange large", pImage2: "org.jpg"});
lib.insert("prodlist", {pName: "Sweet Lime", pLocalName: "Sweet Lime", pImage2: "org.jpg"});
lib.commit();
console.log(lib.queryAll("prodlist", { distinct: ["pName", "pLocalName", "pImage2"]}));
multiple fields usage in distinct parameter is expected to play the role in the feature and uniqueness criteria
as three fields are used it is expected to return all the three rows as unique
console.log(lib.queryAll("prodlist", { distinct: ["pName", "pLocalName", "pImage2"]})); expected to return all three
console.log(lib.queryAll("prodlist", { distinct: ["pImage2"]})); may return 1 row
@girishawate Similar to SQL DISTINCT, the uniqueness is applied to columns across different rows, not columns across one row.
lib.queryAll("books", { distinct: ["year", "author"]});
I have used DomSQL.queryAll("prodlist", { distinct: ["pName", "pLocalName", "pImage2"]}); where pName and pLocalName are having spaces and pImage2 may or may not be distinct alone eg. record 1: Orange small, Orange small, org.jpg record 2: Orange large, Orange large, org.jpg record 3: Sweet Lime, Sweet Lime, org.jpg
return data fails to provide all three records Note: data is to explain the case and has no literal meaning
Thanks for good work