Classes
Namespaces
Members
-
<static> LOGLEVEL :String
-
You can change this value with
debug
,info
,warn
,error
.Type:
- String
- Default Value:
- "warn"
- Source:
- See:
-
<static> LONGOROOT :String
-
The root path for Longo components This value is automatically updated on window onload event.
If you want to access DB object before window onload,
be sure that set correct path withsetRoot
.Type:
- String
- Default Value:
- "/Longo.js"
- Source:
- See:
-
<static, constant> VERSION :String
-
VERSION of module
Type:
- String
-
<static> WORKERJS :String
-
If you are using longo.min.js,
this value will be automatically replaced withlongoWorker.min.js
Type:
- String
- Default Value:
- "longoWorker.js"
- Source:
- See:
Methods
-
<static> createDB(name) → {DB}
-
Return new database instance.
If sepcifyed name database is already exists, return that database.Parameters:
Name Type Argument Default Description name
String <optional>
'temp' database name
Returns:
db
- Type
- DB
-
<static> getRoot()
-
Return rootPath for longo modules
-
<static> getVersion()
-
Return version of Longo module
-
<static> setLogLevel(loglevel)
-
Set logging level.
Parameters:
Name Type Description loglevel
string log
,debug
,info
,warn
,error
-
<static> setRoot(root)
-
Set rootPath for longo modules
This method will be called when windowload
event fired.Parameters:
Name Type Description root
String Abstruct path of longo root
Example
Longo.setRoot("/javascript/vender/longo");
-
<static> use(name) → {DB}
-
Alias for Longo.createDB().
Parameters:
Name Type Description name
String database name
Returns:
db
- Type
- DB
Example
var db = Longo.use("School"); db.collection("students").insert({name:"tome",score:100}).done();
-
<static> useMinified()
-
Force to use minified longoWorker module.