Description: Get the unique ID of a component
Schema: _Component

Example

component.id();
Suggest Edits

classInfo( )

 

Description: Give all informations about the model of the component
Schema: _Component

Example

component.classInfo();
Suggest Edits

destroy( )

 

Description: Destroy the component
Schema: _Component

Example

component.destroy();
Suggest Edits

off( event )

 

Description: Remove a listener
Schema: _Component

Example

component.off('eventName');
Suggest Edits

on( event, action, useCoreAPI, isCore )

 

Description: Add an event
Schema: _Component

Example

component.on('eventName', () => {});
Suggest Edits

require( id )

 

Description: Get a component by its unique id
Schema: _Component

Example

component.require('db');
Suggest Edits

install( path , async )

 

Description: Install a system given a relative path. async parameter is optional.
Schema: _Runtime
Inherit: _Component

Example

const systemId = runtime.install('app.json');
  • on server, systems are installed synchronously (i.e. async parameter can not be set) and
  • on client, async parameter is set to true by default.
Suggest Edits

message( msg )

 

Description: Send a message to the system
Schema: _Runtime
Inherit: _Component

Example

runtime.message({
  'event': 'an_event',
  'from': 'system_id',
  'data': ['val1', true, {'key':'val'}]
});
Suggest Edits

start( id )

 

Description: Start a system given an id
Schema: _Runtime
Inherit: _Component

Example

runtime.start(systemId);
Suggest Edits

stop( id )

 

Description: Stop a system given an id
Schema: _Runtime
Inherit: _Component

Example

runtime.stop(systemId);
Suggest Edits

status( )

 

Description: Show the status of all the installed systems
Schema: _Runtime
Inherit: _Component

Example

runtime.status();
Suggest Edits

system( )

 

Description: Get the current system
Schema: _Runtime
Inherit: _Component

Example

const system = runtime.system();
Suggest Edits

system( name )

 

Description: Create a system
Schema: _Runtime
Inherit: _Component

Example

runtime.system('mySystem');
Suggest Edits

uninstall( id )

 

Description: Uninstall a system given an id
Schema: _Runtime
Inherit: _Component

Example

runtime.uninstall(systemId);
Suggest Edits

bundle( )

 

Description: Bundle the running system into a stringified JSON object
Schema: _Runtime
Inherit: _Component

Example

runtime.bundle();
Suggest Edits

create( )

 

Description: Create a model
Schema: _Metamodel
Inherit: _Component

Example

runtime.require('metamodel').create();
Suggest Edits

model( name, définition )

 

Description: Override a model
Schema: _Metamodel
Inherit: _Component

Example

runtime.require('metamodel').model('Person', {
  'name': 'string',
  'firstName': 'string'
});
Suggest Edits

schema( name, definition )

 

Description: Define a schema
Schema: _Metamodel
Inherit: _Component

Example

runtime.require('metamodel').schema('Person', {
  'name'; 'property',
  'firstName': 'property'
});
Suggest Edits

type( name, definition )

 

Description: Define a type
Schema: _Metamodel
Inherit: _Component

Example

runtime.require('metamodel').type('color', ['blue', 'white', 'red']);
Suggest Edits

debug( message )

 

Description: Log an information
Schema: _Logger
Inherit: _Component

runtime.require('logger').debug('this is a debug message');
Suggest Edits

error( message )

 

Description: Log an error
Schema: _Logger
Inherit: _Component

Example

runtime.require('logger').error('this is an error message');
Suggest Edits

info( message )

 

Description: Log an information
Schema: _Logger
Inherit: _Component

Example

runtime.require('logger').info('this is an info message');
Suggest Edits

level( levelName )

 

Description: Set the level of log
Schema: _Logger
Inherit: _Component

Example

runtime.require('logger').level('info');
Suggest Edits

warn( message )

 

Description: Log a warning
Schema: _Logger
Inherit: _Component

Example

runtime.require('logger').warn('this is a warning message');
Suggest Edits

collections( )

 

Description: Get collections of documents managed by System Runtime NoSQL Database. Each collection provides a basic set of APIs to find, update, insert or delete documents
Schema: _Database
Inherit: _Component

Example

runtime.require('db').collections().Person.find({
  'firstName': 'Laure'
});
 

Description: Count the number of document in a collection

runtime.require('db').collections().Person.count();
Suggest Edits

find( query )

 

Description: Find a document into the collection

runtime.require('db').collections().Person.find({
  'firstName': 'Laure'
});

You can use query selectors:

runtime.require('db').collections().Person.find({
  'firstName': {
    '$eg': 'Laure
  }
});

You can also sort the result:

runtime.require('db').collections().Person.find().sort({
  'name': 1
});
Suggest Edits

insert( document )

 

Description: Insert an new document into the collection

runtime.require('db').collections().Person.insert({
  'firstName': 'Laure',
  'age': 50
});
Suggest Edits

update( query, document, option )

 

Description: Update documents into a collection

runtime.require('db').collections().Person.update(
  {'name': 'Jean'},
  {'age': 30}, 
  {'upsert': true}
);
Suggest Edits

remove( query )

 

Description: Remove a document from the collection

runtime.require('db').collections().Person.remove(
  {'name': 'Jean'}
);