An interactive shell interface to Nodenamo
* IMPORT
* INSERT
* GET
* LIST
* FIND
* UPDATE
* ON
* DELETE
* UNLOAD TABLE
* CREATE TABLE
* DELETE TABLE
* SHOW TABLES
* EXPLAIN
* DESCRIBE
#### Syntax
IMPORT _class_ FROM _"path"_
IMPORT _class_ AS alias FROM _"path"_
IMPORT _{class}_ FROM _"path"_
IMPORT _{class as alias}_ FROM _"path"_
where:
* class is the exported class decorated with nodenamo's @DBTable
* alias is an alias to be referenced to the imported class from subsequent statements.
* path is the path to the file or a package containing the class to import.
```
IMPORT usersTable as users FROM "./usersTable.ts"
#### Syntax
INSERT _jsonObject_ INTO _table_ WHERE _expression_
``
INSERT {id:2,title:"some thing",price:21,status:true} INTO books WHERE attribute_not_exists(id)
#### Syntax
GET _id_ FROM _table_ STRONGLY CONSISTENT
``
GET 42 FROM users STRONGLY CONSISTENT
#### Syntax
LIST _projections_ FROM _table_ USING _indexName_ BY _hashRange_ FILTER _filterExpressions_ RESUME "lastEvaluatedKey" ORDER _order_ LIMIT _number_ STRONGLY CONSISTENT
where:
projections is a list of properties to return. Use to return all properties.indexName
* is the name of a GSI.hashRange
* is a value to search against a hash property. It can be optionally followed by a comma and a value to search against a range property.order
* is ASC or DESCstrongly consistent
* can be used to request a consistent read.
``
LIST * FROM users BY "name" , "timestamp" FILTER email = "someone@example.com" ORDER asc LIMIT 10 STRONGLY CONSISTENT
#### Syntax
FIND _projections_ FROM _table_ USING _indexName_ WHERE _keyConditions_ FILTER _filterExpressions_ RESUME "lastEvaluatedKey" ORDER _order_ LIMIT _number_ STRONGLY CONSISTENT
where:
projections is a list of properties to return. Use to return all properties.indexName
* is the name of a GSI.order
* is ASC or DESCstrongly consistent
* can be used to request a consistent read.
``
FIND id, name, email FROM users USING users-gsi WHERE name = "some one" FILTER email = "someone@example.com" resume "token" ORDER desc LIMIT 2 STRONGLY CONSISTENT
#### Syntax
UPDATE _jsonObject_ FROM _table_ WHERE _conditionExpression_ WITH VERSION CHECK
where:
* WITH VERSION CHECK can be used to request a version check.
``
UPDATE {id:1,name:"new name"} FROM users WHERE attribute_not_exists(id) WITH VERSION CHECK
#### Syntax
ON _id_ FROM _table_ SET_setExpression_ ADD _addExpression_ DELETE _deleteExpression_ REMOVE _removeExpression_ _conditionExpression_ WITH VERSION CHECK
where:
* WITH VERSION CHECK can be used to request a version check.
``
ON 42 FROM users SET lastViewed = "today" ADD count 1 WHERE published = true WITH VERSION CHECK
#### Syntax
DELETE _id_ FROM _table_ WHERE _conditionExpression_
``
DELETE 42 FROM books WHERE deleted <> true
#### Syntax
UNLOAD TABLE _name_
where:
* name is the imported class name or its alias.
``
UNLOAD TABLE users
#### Syntax
CREATE TABLE FOR _name_ WITH CAPACITY OF readCapacityNumber, writeCapacityNumber
where:
* name is the imported class name or its alias.readCapacityNumber
* is the desired read capacity for the table.writeCapacityNumber
* is the desired write capacity for the table.
``
CREATE TABLE FOR users WITH CAPACITY OF 123, 456
#### Syntax
DELETE TABLE FOR _name_
where:
* name is the imported class name or its alias.
``
DELETE TABLE FOR users
#### Syntax
SHOW TABLES
``
SHOW TABLES
#### Syntax
Explain statement
where:
* statement is one of nodenamo query language stattements.
``
EXPLAIN INSERT {id:1,name:"some one"} INTO users
#### Syntax
Describe _name_
where:
* name is the imported class name or its alias.
``
DESCRIBE users
`javascript``
{
type: 'describe',
name: 'users'
}