Skip to content
Advertisement

Filtering existing objects with SQL query

I’m looking for a library that could filter javascript collections of objets from a SQL query. No such results on Google :/

For example, this objects collection…

var objects = [{id : 1, name : "o1"},{id : 2, name : "o2"}]

filtered with…

SELECT * FROM objects WHERE id = 1

would return…

[{id : 1, name : "o1"}]

Do you know if such a library already exists ? Or should I devellop it by myself… ? (Uhh –‘)

Thanks all !

Advertisement

Answer

Thanks for all these answers 😉 Well, such a library does not seems to exist :/ I bypassed the problem and focused only on the Where clause : I built a class specialized in handling a where clause. This class can even return a SQL Where clause string (used in a further request) or filter a collection or objects.

Thanks for your answers, they all helped me in solving my problem 😉

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement