MentDB, The digital brain.  About me Home
Back / All functions / JSON

Record

node create node create|insert|addnode existnode insert into objectnode shownode show detailednode count elementnode fieldsnode insert into arraynode insert into arraynode is arraynode is objectnode select elementnode update arraynode update objectnode delete from arraynode delete from object

In memory

json loadjson load selectjson load by refjson show keyjson insert into objectjson count elementjson select elementjson is objectjson is arrayjson is loadedjson docjson fieldsjson insert into arrayjson insert into arrayjson set into arrayjson update arrayjson update objectjson delete from arrayjson delete from objectjson unloadjson unload_all

node create <key>

Synonymous

    node create|insert|add

Description

    To create a new empty node

Parameters

    key:   The key - string - required
admin
node create "keyId"
mentdb
Node keyId created with successful.

node exist <key>

Description

    To check if a node already exist

Parameters

    key:   The key - string - required
admin
node exist "keyId"
mentdb
1

node insert into object <key> <jPath> <fieldname> <value> <type>

Description

    To insert an element into an object in a node

Parameters

    key:   The key - string - required
    jPath:   The JSON path - string - required
    fieldname:   The fieldname - string - required
    value:   The value - string - required
    type:   The type (NUM|STR|BOOL|ARRAY|OBJ) - string - required
admin
node insert into object "keyId" / a 5 NUM
mentdb
Inserted with successful.
admin
node insert into object "keyId" / tab "[]" ARRAY
mentdb
Inserted with successful.

node show <key>

Description

    To show a specific node

Parameters

    key:   The key - string - required
admin
node show "keyId"
mentdb
{
"a": 5.0,
"tab": [],
"key": "keyId"
}

node show detailed <key>

Description

    To show a node with detailed information

Parameters

    key:   The key - string - required
admin
node show detailed "keyId"
mentdb
{
"dataFileId": 0,
"dataFilePosition": 1579520,
"data": "{\"a\":5.0,\"tab\":[],\"key\":\"keyId\"}",
"size": 32,
"indexFileTabPosition": 5,
"key": "keyId",
"indexFileToWrite": 282
}

node count element <key> <jPath>

Description

    To count element in a node

Parameters

    key:   The key - string - required
    jPath:   The JSON path - string - required
admin
node count element "keyId" /
mentdb
3

node fields <key> <jPath>

Description

    To get all fields into an object in a node

Parameters

    key:   The key - string - required
    jPath:   The JSON path - string - required
admin
node fields "keyId" /
mentdb
[
"a",
"tab",
"key"
]

node insert into array <key> <jPath> <value> <type>

Description

    To insert an element into an array in a node

Parameters

    key:   The key - string - required
    jPath:   The JSON path - string - required
    value:   The value - string - required
    type:   The type (NUM|STR|BOOL|ARRAY|OBJ) - string - required
admin
node insert into array "keyId" /tab test STR
mentdb
Inserted with successful.
admin
node insert into array "keyId" /tab test2 STR
mentdb
Inserted with successful.
admin
node show "keyId"
mentdb
{
"a": 5.0,
"tab": [
"test",
"test2"
],
"key": "keyId"
}

node insert into array <key> <jPath> <index> <value> <type>

Description

    To insert an element into an array in a node

Parameters

    key:   The key - string - required
    jPath:   The JSON path - string - required
    index:   The index position - string - required
    value:   The value - string - required
    type:   The type (NUM|STR|BOOL|ARRAY|OBJ) - string - required
admin
node insert into array "keyId" /tab 0 test STR
mentdb
Inserted with successful.
admin
node insert into array "keyId" /tab test2 STR
mentdb
Inserted with successful.
admin
node show "keyId"
mentdb
{
"a": 5.0,
"tab": [
"test",
"test",
"test2",
"test2"
],
"key": "keyId"
}

node is array <key> <jPath>

Description

    To check if an element is an array in a node

Parameters

    key:   The key - string - required
    jPath:   The JSON path - string - required
admin
node is array "keyId" /tab
mentdb
1

node is object <key> <jPath>

Description

    To check if an element is an object in a node

Parameters

    key:   The key - string - required
    jPath:   The JSON path - string - required
admin
node is object "keyId" /
mentdb
1

node select element <key> <jPath>

Description

    To select an element in a node

Parameters

    key:   The key - string - required
    jPath:   The JSON path - string - required
admin
node select element "keyId" /a
mentdb
5.0

node update array <key> <jPath> <index> <value> <type>

Description

    To update an element into an array in a node

Parameters

    key:   The key - string - required
    jPath:   The JSON path - string - required
    index:   The index - integer - required
    value:   The value - string - required
    type:   The type (NUM|STR|BOOL|ARRAY|OBJ) - string - required
admin
node update array "keyId" /tab 1 test2 STR
mentdb
Updated with successful.
admin
node show "keyId"
mentdb
{
"a": 5.0,
"tab": [
"test",
"test2",
"test2",
"test2"
],
"key": "keyId"
}

node update object <key> <jPath> <fieldname> <value> <type>

Description

    To update an element into an object in a node

Parameters

    key:   The key - string - required
    jPath:   The JSON path - string - required
    fieldname:   The fieldname - string - required
    value:   The value - string - required
    type:   The type (NUM|STR|BOOL|ARRAY|OBJ) - string - required
admin
node update object "keyId" / a 8 NUM
mentdb
Updated with successful.
admin
node show "keyId"
mentdb
{
"a": 8.0,
"tab": [
"test",
"test2",
"test2",
"test2"
],
"key": "keyId"
}

node delete from array <key> <jPath> <index>

Description

    To delete an element from an array in a node

Parameters

    key:   The key - string - required
    jPath:   The JSON path - string - required
    index:   The index - integer - required
admin
node delete from array "keyId" /tab 0
mentdb
Deleted with successful.
admin
node show "keyId"
mentdb
{
"a": 8.0,
"tab": [
"test2",
"test2",
"test2"
],
"key": "keyId"
}

node delete from object <key> <jPath> <fieldname>

Description

    To delete an element from an object in a node

Parameters

    key:   The key - string - required
    jPath:   The JSON path - string - required
    fieldname:   The fieldname - string - required
admin
node delete from object "keyId" / a
mentdb
Deleted with successful.
admin
node show "keyId"
mentdb
{
"tab": [
"test2",
"test2",
"test2"
],
"key": "keyId"
}

json load <key> <jsonString>

Description

    To load a json string

Parameters

    key:   The key - string - required
    jsonString:   The JSON string - string - required
admin
json load "keyId" "{}"
mentdb
1

json load select <key> <jsonString> <jPath>

Description

    To load a json string and select an element

Parameters

    key:   The key - string - required
    jsonString:   The JSON string - string - required
    jPath:   The JSON path - string - required
admin
json load select "keyId" "{\"a\": 5.0, \"b\": {\"c\": 7.0}}" /a
mentdb
5.0

json load by ref <fromKey> <jPath> <new KeyId>

Description

    To load by ref a json string from another json object

Parameters

    fromKey:   The key - string - required
    jPath:   The JSON path - string - required
    new KeyId:   The JSON string - string - required
admin
json load by ref "keyId" /b "newKeyId"
mentdb
{
"c": 7.0
}
admin
json update object "newKeyId" / c 8 NUM;
json select element "newKeyId" /c;
mentdb
8.0
admin
json doc "keyId";
mentdb
{
"a": 5.0,
"b": {
"c": 8.0
}
}

json show key

Description

    To show all JSON object saved into the session

admin
json show key
mentdb
["keyId"]

json insert into object <key> <jPath> <fieldname> <value> <type>

Description

    To insert an element into an object in a node

Parameters

    key:   The key - string - required
    jPath:   The JSON path - string - required
    fieldname:   The fieldname - string - required
    value:   The value - string - required
    type:   The type (NUM|STR|BOOL|ARRAY|OBJ) - string - required
admin
json insert into object "keyId" / a 5 NUM
mentdb
1
admin
json insert into object "keyId" / tab "[]" ARRAY
mentdb
1

json count element <key> <jPath>

Description

    To count element in a node

Parameters

    key:   The key - string - required
    jPath:   The JSON path - string - required
admin
json count element "keyId" /
mentdb
2

json select element <key> <jPath>

Description

    To select an element in a node

Parameters

    key:   The key - string - required
    jPath:   The JSON path - string - required
admin
json select element "keyId" /a
mentdb
5.0

json is object <key> <jPath>

Description

    To check if an element is an object in a node

Parameters

    key:   The key - string - required
    jPath:   The JSON path - string - required
admin
json is object "keyId" /
mentdb
1

json is array <key> <jPath>

Description

    To check if an element is an array in a node

Parameters

    key:   The key - string - required
    jPath:   The JSON path - string - required
admin
json is array "keyId" /tab
mentdb
1

json is loaded <key>

Description

    To check if a key is loaded

Parameters

    key:   The key - string - required
admin
json is loaded "keyId"
mentdb
1

json doc <key>

Description

    To get a json document

Parameters

    key:   The key - string - required
admin
json doc "keyId"
mentdb
{
"a": 5.0,
"tab": []
}

json fields <key> <jPath>

Description

    To get all fields into an object in a node

Parameters

    key:   The key - string - required
    jPath:   The JSON path - string - required
admin
json fields "keyId" /
mentdb
[
"a",
"tab"
]

json insert into array <key> <jPath> <value> <type>

Description

    To insert an element into an array in a node

Parameters

    key:   The key - string - required
    jPath:   The JSON path - string - required
    value:   The value - string - required
    type:   The type (NUM|STR|BOOL|ARRAY|OBJ) - string - required
admin
json insert into array "keyId" /tab test STR
mentdb
1
admin
json insert into array "keyId" /tab test2 STR
mentdb
1
admin
json doc "keyId"
mentdb
{
"a": 5.0,
"tab": [
"test",
"test2"
]
}

json insert into array <key> <jPath> <index> <value> <type>

Description

    To insert an element into an array in a node

Parameters

    key:   The key - string - required
    jPath:   The JSON path - string - required
    index:   The index position - number - required
    value:   The value - string - required
    type:   The type (NUM|STR|BOOL|ARRAY|OBJ) - string - required
admin
json insert into array "keyId" /tab 0 test STR
mentdb
1
admin
json insert into array "keyId" /tab test2 STR
mentdb
1
admin
json doc "keyId"
mentdb
{
"a": 5.0,
"tab": [
"test",
"test",
"test2",
"test2"
]
}

json set into array <key> <jPath> <index> <value> <type>

Description

    To set an element into an array in a node

Parameters

    key:   The key - string - required
    jPath:   The JSON path - string - required
    index:   The index position - number - required
    value:   The value - string - required
    type:   The type (NUM|STR|BOOL|ARRAY|OBJ) - string - required
admin
json set into array "keyId" /tab 0 test STR
mentdb
1
admin
json insert into array "keyId" /tab test2 STR
mentdb
1
admin
json doc "keyId"
mentdb
{
"a": 5.0,
"tab": [
"test",
"test",
"test2",
"test2",
"test2"
]
}

json update array <key> <jPath> <index> <value> <type>

Description

    To update an element into an array in a node

Parameters

    key:   The key - string - required
    jPath:   The JSON path - string - required
    index:   The index - integer - required
    value:   The value - string - required
    type:   The type (NUM|STR|BOOL|ARRAY|OBJ) - string - required
admin
json update array "keyId" /tab 1 test2 STR
mentdb
1
admin
json doc "keyId"
mentdb
{
"a": 5.0,
"tab": [
"test",
"test2",
"test2",
"test2",
"test2"
]
}

json update object <key> <jPath> <fieldname> <value> <type>

Description

    To update an element into an object in a node

Parameters

    key:   The key - string - required
    jPath:   The JSON path - string - required
    fieldname:   The fieldname - string - required
    value:   The value - string - required
    type:   The type (NUM|STR|BOOL|ARRAY|OBJ) - string - required
admin
json update object "keyId" / a 8 NUM
mentdb
1
admin
json doc "keyId"
mentdb
{
"a": 8.0,
"tab": [
"test",
"test2",
"test2",
"test2",
"test2"
]
}

json delete from array <key> <jPath> <index>

Description

    To delete an element from an array in a node

Parameters

    key:   The key - string - required
    jPath:   The JSON path - string - required
    index:   The index - integer - required
admin
json delete from array "keyId" /tab 0
mentdb
1
admin
json doc "keyId"
mentdb
{
"a": 8.0,
"tab": [
"test2",
"test2",
"test2",
"test2"
]
}

json delete from object <key> <jPath> <fieldname>

Description

    To delete an element from an object in a node

Parameters

    key:   The key - string - required
    jPath:   The JSON path - string - required
    fieldname:   The fieldname - string - required
admin
json delete from object "keyId" / a
mentdb
1
admin
json doc "keyId"
mentdb
{
"tab": [
"test2",
"test2",
"test2",
"test2"
]
}

json unload <key>

Description

    To unload a json document

Parameters

    key:   The key - string - required
admin
json unload "keyId"
mentdb
1

json unload_all

Description

    To unload all json documents

admin
json unload_all
mentdb
0




© 2012-2017 - Jimmitry Payet.