BETA
My accountGet started
Dec 052016
Total.js Platform

New Total.js version v2.3.0

We have published a new Total.js version with new features and fixes. Read more what is new.

New Total.js version v2.3.0

New Total.js v2.3.0 is 98% backwards compatible.

News

NoSQL embedded database

I have performed a big step to increase performance with a new great features. NoSQL embedded database can be used as a separated module $ npm install nosql (it's without dependencies). This database is a great product for small projects.

In-memory mode:

  • all documents are loaded into the memory and each change is stored on the file system
  • performance is awesome

Joins:

  • we can join documents between different databases

Scalar operations:

  • sum, count, min, max, avg and group
  • works with joins

New date filters:

  • DatabaseBuilder.day(field, [operator], value)
  • DatabaseBuilder.month(field, [operator], value)
  • DatabaseBuilder.year(field, [operator], value)

Random documents:

New version supports random feature. DatabaseBuilder.random() will return random documents.

Updated insert/update/modify operations:

NoSQL Binary:

NoSQL events:

Workflows

This is a new feature in this version. Workflows describes SchemaBuilder operations in a file named /workflows with the same structure as the /sitemap file. Controller contains a new schema method controller.$exec(workflow_name, callback) which executes all workflow operations in order, e.g. /workflows:

Controlller:

IMPORTANT: (response) keyword means that controller.$exec() returns only the one result from this operation. Otherwise returns array of results from operations.

New SchemaBuilder types

Describing SchemaBuilder operations

How to get all schema descriptions?

Added a new argument in all SchemaBuilder operations

  • controller argument is filled when an operation is executed from a controller

Scripting

This new feature is really great solution for user-defined scripts because a scope of the script is secured (require and global variables/aliases are not accessible with except RESTBuilder). It's an experiment and more info in Total.js documentation. This solution doesn't use Node.js vm.

Data validators

You can change built-in Regular Expression validators easily. These validators use Total.js Schemas.

View Engine

  • supports @{continue} and @{break} commands in loops
  • updated compilation of dynamic views to new methods:

Common

  • Controller is a global variable, so it's easy to extend its prototype
  • F.kill([signal]) is a new method for killing instance of Total.js
  • HttpFile.rename(filename, [callback(err)]) performs rename operation for an uploaded file

Support Total.js on GitHub and follow us on Twitter: @totalframework. We have prepared another updates, so stay tuned for more.