Artem Flo edited this page Nov 1, 2015 · 1 revision

AsmDB is just a file db.js near the bitasm framework. It contains a system that returns a database for using in a bitASM application. Do not modify any function inside it.

The structure of a database you should define:

var structures = {
        name: [‘fieldName’,’fieldName’,’fieldName’, …]
    },
    data = {
        name: [‘content’,0,true,…]
    }

Structures is an object that contains elements describing your records. Each structure is an array type of:

Name: [‘fieldName’, ‘fieldName’, …]

Each structure corresponds to a data element with the same name.

Data is an object that contains your database records. Names of children of data should match the structures. For example see db.js in the boilerplate. Every record in the data element could be an array or an object.

Data = {
    arrayType: [
        [‘somedata’, ‘someotherdata’, …],
        [‘and one more’,’and more’, …]
    ], 
    objectType: {
        subobject: [
            [‘subobject’, ‘should be an array’, …]
        ]
    }

AsmDB-path

Elements with type of array could be used in asmDB-path just like by name:

<div class=”template tmpl-1”>arrayType</div>

Elements with type of object should be used like this:

<div class=”template tmpl-2”>objectType/subobject</div>

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.