1.0.14 • Published 2 years ago

json_basic_query v1.0.14

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

json_basic_query

License: MIT NPM Downloads Play with docs

Instructions:

npm install json_basic_query
const json_basic_query =  require('json_basic_query')

If utilizing in html...:

<script src="./node_modules/json_basic_query/index.js"></script>
<script> 
$(()=> { 
     const output =  json_basic_query.method(parameter)
 })
</script>
await delById(filename, table, id) // returns true
await delByKeyValue(filename, table, key, value) // returns true 
await getByObject(filename, table, object) // returns array 
await getAll(filename, table)
await getObjectCount(filename, table,object)
await tableColValCount(filename, table, key, value)
await getOneById(filename, table, id)
await getByObject(filename, table, object)
await directPost(filename, table, object) // incremenets id
await post(filename, table, object)  // returns object;  - if problem, tagsnippet, device, cheatsheet or task, will also add to hourglass. 
await update(filename, table, id, object) // checks for cheatsheet, tag_snippet, problem, tag_snippet, appends [edit] 
await directUpdate(filename, table, id, object)

Functions

formatToType() ⇒ object

Kind: global function
Date: 2022-03-22
Author: zen-out
Example

let object = formatToType("problem", object)
// ensures that the problem object matches 

mergeWith() ⇒ object

Kind: global function
Date: 2022-03-22
Author: zen-out
Example

mergeWith("problem", object)
// returns with undefined

getAll(table) ⇒ any

Kind: global function
Date: 2022-03-22
Author: zen-out

ParamType
tableany

Example

getAll(filename, table)

getObjectCount(table, object) ⇒ any

Kind: global function
Date: 2022-03-22
Author: zen-out

ParamType
tableany
objectany

Example

getObjectCount(filename, table, object)

tableColValCount(table, key, value) ⇒ any

Kind: global function
Date: 2022-03-22
Author: zen-out

ParamType
tableany
keyany
valueany

Example

tableCoLValCount(filename, table, key, value)

getOneById(table, id) ⇒ any

Kind: global function
Date: 2022-03-22
Author: zen-out

ParamType
tableany
idany

getByObject() ⇒ array

getByObject(filename, hourglass, )

Kind: global function
Date: 2022-03-22
Author: zen-out

directPost(filename, table, object) ⇒ any

Kind: global function
Date: 2022-03-22
Author: zen-out

ParamType
filenameany
tableany
objectany

Example

let post_user = directPost(filename, "user", object)

post(filename, table, object) ⇒ any

Kind: global function
Date: 2022-03-22
Author: zen-out

ParamType
filenameany
tableany
objectany

Example

let post_task = post("./db.json", "task", inputs["task"])

directUpdate()

Kind: global function
Author: github.com/zen-out
Example

directUpdate(filename, table, id, object) // does not add edit to the object - clean update. 

update()

Kind: global function
Author: github.com/zen-out
Example

await update(filename, table, id, object)
1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago