MentDB, The digital brain.  About us Home
Back / All functions / Node

The nodes are stored in the storage structure in JSON.
You can change them at any time.
Beware, however, of data corruptions.

node create node create|insert|addnode existnode iobjectnode shownode show detailednode countnode fieldsnode iarraynode iarraynode is arraynode is objectnode selectnode uarraynode uobjectnode darraynode dobject

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 iobject <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 iobject "keyId" / a 5 NUM
mentdb
Inserted with successful.
admin
node iobject "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 <key> <jPath>

Description

    To count element in a node

Parameters

    key:   The key - string - required
    jPath:   The JSON path - string - required
admin
node count "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 iarray <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 iarray "keyId" /tab test STR
mentdb
Inserted with successful.
admin
node iarray "keyId" /tab test2 STR
mentdb
Inserted with successful.
admin
node show "keyId"
mentdb
{
"a": 5.0,
"tab": [
"test",
"test2"
],
"key": "keyId"
}

node iarray <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 iarray "keyId" /tab 0 test STR
mentdb
Inserted with successful.
admin
node iarray "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 <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 "keyId" /a
mentdb
5.0

node uarray <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 uarray "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 uobject <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 uobject "keyId" / a 8 NUM
mentdb
Updated with successful.
admin
node show "keyId"
mentdb
{
"a": 8.0,
"tab": [
"test",
"test2",
"test2",
"test2"
],
"key": "keyId"
}

node darray <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 darray "keyId" /tab 0
mentdb
Deleted with successful.
admin
node show "keyId"
mentdb
{
"a": 8.0,
"tab": [
"test2",
"test2",
"test2"
],
"key": "keyId"
}

node dobject <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 dobject "keyId" / a
mentdb
Deleted with successful.
admin
node show "keyId"
mentdb
{
"tab": [
"test2",
"test2",
"test2"
],
"key": "keyId"
}




© 2012 - 2019 - Innov-AI.