1.1.8 • Published 5 years ago

megaquery v1.1.8

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

MegaQuery

MeagaQuery is a database that is designed to search billions of key's that are similar, like a license plate number or a GeoKey, and runs on very low end hardware like a laptop.

Running:

First download this megaquery

npm install megaquery

then run it in your application

const megaquery = require('megaquery');
megaquery.startServer(8080); // Your can use any port you want

// rest of your code

Storing a value

HTTP

curl "http://localhost:8080/database/?key=KEY&value=VALUE"

Outputting
>>> {sucess: true}

Node.JS

megaquery({
  key: KEY,
  value: VALUE
}, (logs) => {
  // logs >> {sucess: true}
});

Replace KEY with the key you want to look up the value with, and replace VALUE with the data you want to store.

Error's

curl "http://localhost:8080/database/?key=KEY&value=VALUE"

Outputting
>>> {error: 'file exists, overwrite with &overwrite=true'}

This means you are trying to write over a existing file but you can fix it by doing this

HTTP

curl "http://localhost:8080/database/?key=KEY&value=VALUE&overwrite=true"

Outputting
>>> {sucess: true}

Node.JS

megaquery({
  key: KEY,
  value: VALUE,
  overwrite: "true" // this has to be a string
}, (logs) => {
  // logs >> {sucess: true}
});

Reading a value

HTTP

curl "http://localhost:8080/database/?q=KEY"

Outputting
>>> VALUE

Node.JS

megaquery({
  q: KEY
}, (data) => {
  // Do Whatever
});

Replace KEY with the key you previously used to store the value, VALUE is what ever you stored on the server with the KEY

Error's

HTTP

curl "http://localhost:8080/database/?q=KEY"

Outputting
>>> {error: 'value doesn't exist'}

This means you haven't stored any values with the corresponding key

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago