1.0.14 • Published 2 years ago
json_basic_query v1.0.14
json_basic_query
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
Param | Type |
---|---|
table | any |
Example
getAll(filename, table)
getObjectCount(table, object) ⇒ any
Kind: global function
Date: 2022-03-22
Author: zen-out
Param | Type |
---|---|
table | any |
object | any |
Example
getObjectCount(filename, table, object)
tableColValCount(table, key, value) ⇒ any
Kind: global function
Date: 2022-03-22
Author: zen-out
Param | Type |
---|---|
table | any |
key | any |
value | any |
Example
tableCoLValCount(filename, table, key, value)
getOneById(table, id) ⇒ any
Kind: global function
Date: 2022-03-22
Author: zen-out
Param | Type |
---|---|
table | any |
id | any |
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
Param | Type |
---|---|
filename | any |
table | any |
object | any |
Example
let post_user = directPost(filename, "user", object)
post(filename, table, object) ⇒ any
Kind: global function
Date: 2022-03-22
Author: zen-out
Param | Type |
---|---|
filename | any |
table | any |
object | any |
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)