Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/imteekay/sql-query-json
Experiment SQL-query in JavaScript for JSON
https://github.com/imteekay/sql-query-json
javascript js json query sql sql-query
Last synced: 28 days ago
JSON representation
Experiment SQL-query in JavaScript for JSON
- Host: GitHub
- URL: https://github.com/imteekay/sql-query-json
- Owner: imteekay
- License: mit
- Created: 2019-07-21T15:44:57.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-08-11T18:50:59.000Z (over 5 years ago)
- Last Synced: 2025-01-05T18:46:15.406Z (about 1 month ago)
- Topics: javascript, js, json, query, sql, sql-query
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SQL Query JSON
Experiment SQL-query in JavaScript for JSON
You have this JSON:
```javascript
const json = {
users: [
{
'id': 1,
'name': 'TK',
'age': 26,
'email': '[email protected]'
},
{
'id': 2,
'name': 'Daniel',
'age': 30,
'email': '[email protected]'
},
{
'id': 3,
'name': 'Kaio',
'age': 11,
'email': '[email protected]'
}
]
};
```And you want this interface (like a SQL query):
```javascript
select(['id', 'name'])
.from('users')
.where('id', 1);
```An the result should be:
```javascript
[{ id: 1, name: 'TK' }]
```