Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

274
Vistas
Javascript libraries that allow for SQL-like queries on JSON data?

Say our JSON data comes from a single MySQL table:

someJSON =    [ { name: 'bill' , sex:'M', income:50000 },
                { name: 'sara' , sex:'F', income:100000 },
                 ...
               ];

And say the pseudo-code is:

"Get all the person objects of all sex:F of income > 60000`".

Are there any javascript libraries that would allow one to code such queries on this JSON data using a SQL or SQL-like syntax.

In case you are curious, some context:

I am making the front-end of a data analysis web service for my organization without knowing what the future backend will be. In the future they will migrate their data from MS Access tables to some-sort of MySQL-type database. Until then I am using static JSON files to start development and was thinking it may be helpful for them in the future to have my javascript queries appear as MySQL queries. (The current MS Access database is unreachable from the web.)

over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

Check out jslinq:

var myList = [
            {FirstName:"Chris",LastName:"Pearson"},
            {FirstName:"Kate",LastName:"Johnson"},
            {FirstName:"Josh",LastName:"Sutherland"},
            {FirstName:"John",LastName:"Ronald"},
            {FirstName:"Steve",LastName:"Pinkerton"}
            ];

var exampleArray = JSLINQ(myList)
                   .Where(function(item){ return item.FirstName == "Chris"; })
                   .OrderBy(function(item) { return item.FirstName; })
                   .Select(function(item){ return item.FirstName; });
over 4 years ago · Santiago Trujillo Denunciar

0

You can try alasql.js. It is pure JavaScript client-side SQL-server, where you can do queries over JSON objects.

   // Fill table with data
   var data = [ { name: 'bill' , sex:'M', income:50000 },
                { name: 'sara' , sex:'F', income:100000 }];

   // Do the query
   console.log(alasql("SELECT * FROM ? WHERE sex='F' AND income > 60000",[data]));

Try this in Fiddle

over 4 years ago · Santiago Trujillo Denunciar

0

I use Taffydb. TaffyDB is an opensouce library that brings database features into your JavaScript applications. http://taffydb.com/

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda