From 730a2e2814d76382674131c1f71d8e17c307f4e3 Mon Sep 17 00:00:00 2001
From: yoshinorin Loads database. Saves database. Loads database. Saves database. Removes the document. Replaces the document. Saves the document. Updates the document. Removes the document. Replaces the document. Saves the document. Updates the document. Iterates over all documents. Iterates over all documents. See Model#findById. Model name Returns the number of elements. Model name Returns the number of elements. Iterates over all documents. See Model#findById. Inserts a document. Inserts a document. Removes matching documents. Finds a document by its identifier and remove it. Replaces matching documents. Finds a document by its identifier and replace it. Inserts the document if it does not exist; otherwise updates it. Removes matching documents. Finds a document by its identifier and remove it. Replaces matching documents. Finds a document by its identifier and replace it. Inserts the document if it does not exist; otherwise updates it. Sorts documents. See Query#sort. Sorts documents. See Query#sort. Returns an array containing all documents. See Model#findById. Updates matching documents. Finds a document by its identifier and update it. Updates matching documents. Finds a document by its identifier and update it. Iterates over all documents. Iterates over all documents. Returns the number of elements. Number Returns the document at the specified index. Remove all documents. Replace all documents. Remove all documents. Replace all documents. Sorts documents. Example: If the Update all documents. Update all documents. Adds paths. Gets/Sets a path. Adds a post-hook. Adds paths. Gets/Sets a path.=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;lClass default
Index
Constructors
Class default
Index
Constructors
Properties
Properties
Model
Schema
Schema
_models
options
Static
SchemaStatic
SchemaStatic
version Methods
load
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
model
save
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<void>
toJSON
meta: {
version: number;
warehouse: string;
};
models: Record<string, default<any>>;
}Returns {
meta: {
version: number;
warehouse: string;
};
models: Record<string, default<any>>;
}meta: {
version: number;
warehouse: string;
}version: number
warehouse: string
models: Record<string, default<any>>
Parameters
Optional
options: {
path: string;
} & Partial<DatabaseOptions>Returns default
Properties
Model
Schema
Schema
_models
options
Static
SchemaStatic
SchemaStatic
version Methods
load
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
model
save
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<void>
toJSON
meta: {
version: number;
warehouse: string;
};
models: Record<string, default<any>>;
}Returns {
meta: {
version: number;
warehouse: string;
};
models: Record<string, default<any>>;
}meta: {
version: number;
warehouse: string;
}version: number
warehouse: string
models: Record<string, default<any>>
Class default<T>
Abstract
Type Parameters
Indexable
Index
Constructors
Class default<T>
Abstract
Type Parameters
Indexable
Methods
populate
remove
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
replace
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
save
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
to
to
update
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
Type Parameters
Parameters
Optional
data: TReturns default<T>
Methods
populate
remove
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
replace
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
save
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
to
to
update
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
Class default
Hierarchy (view full)
Index
Constructors
Parameters
Optional
code: stringReturns default
Class default
Hierarchy (view full)
Index
Constructors
Parameters
Optional
code: stringReturns default
Class default
Hierarchy (view full)
Index
Constructors
Parameters
Optional
code: stringReturns default
Class default<T>
Type Parameters
Hierarchy
Index
Constructors
Class default<T>
Type Parameters
Hierarchy
Index
Constructors
Properties
Properties
Document
Query
_database
_mutex
data
each
Type declaration
Returns default<T>
Properties
Document
Query
_database
_mutex
data
each
Type declaration
Parameters
Parameters
Returns void
Optional
options: OptionsReturns void
get
length
name
random
schema
size
Type declaration
Returns number
Returns void
get
length
name
random
schema
size
Type declaration
Returns number
Returns default<T> | Record<PropertyKey, any>
every
filter
filter
find
find
find
first
find
find
find
first
for
Returns default<T> | Record<PropertyKey, any>
for
Parameters
Parameters
Returns void
Optional
options: OptionsReturns void
has
insert
insert
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
last
Returns void
has
insert
insert
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
last
limit
map
new
populate
reduce
Returns default<T> | Record<PropertyKey, any>
limit
map
new
populate
reduce
reduce
Returns T
reduce
remove
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
remove
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
replace
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
replace
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
reverse
save
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
shuffle
skip
slice
some
Returns T
remove
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
remove
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
replace
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
replace
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
reverse
save
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
shuffle
skip
slice
some
sort
Parameters
Optional
order: string | numberReturns default<T>
to
sort
Parameters
Optional
order: string | numberReturns default<T>
to
Parameters
Optional
options: OptionsReturns any[]
toJSON
update
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
update
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
Returns any[]
toJSON
update
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
update
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
Class default
Index
Constructors
Class default
Index
Constructors
Methods
Class default<T>
Abstract
Type Parameters
Index
Constructors
Class default<T>
Abstract
Type Parameters
Properties
Abstract
_modelAbstract
_schemadata
each
Type declaration
Parameters
Parameters
Returns void
Returns void
length
random
size
Type declaration
Properties
Abstract
_modelAbstract
_schemadata
each
Type declaration
Parameters
Parameters
Returns void
Returns void
length
random
size
Type declaration
Returns number
Methods
count
eq
num
can be a positive or
+eq
every
every
filter
filter
find
find
first
for
last
limit
map
populate
reduce
find
find
first
for
last
limit
map
populate
reduce
reduce
Returns R
reduce
remove
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
replace
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
reverse
shuffle
skip
slice
some
Returns R
remove
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
replace
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
reverse
shuffle
skip
slice
some
sort
sort
query.sort('date', -1);
query.sort({date: -1, title: 1});
query.sort('-date title');
order
equals to -1
, desc
or descending
, the data will be
returned in reversed order.Parameters
Optional
order: string | number | objectReturns default<T>
to
update
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
Parameters
Optional
order: string | number | objectReturns default<T>
to
update
Parameters
Optional
callback: NodeJSLikeCallback<any>Returns Bluebird<any>
Class default<T>
Type Parameters
Index
Constructors
Class default<T>
Type Parameters
Properties
Types
hooks
post: {
remove: ((...args: any[]) => Bluebird<any>)[];
save: ((...args: any[]) => Bluebird<any>)[];
};
pre: {
remove: ((...args: any[]) => Bluebird<any>)[];
save: ((...args: any[]) => Bluebird<any>)[];
};
}methods
paths
stacks
export: ((data: object) => void)[];
getter: ((data: object) => void)[];
import: ((data: object) => void)[];
setter: ((data: object) => void)[];
}statics
Static
Types Methods
add
Parameters
Returns void
method
path
Parameters
Returns default<any>
Parameters
Returns void
post
Type Parameters
Parameters
Optional
schema: Record<string, AddSchemaTypeOptions>Returns default<T>
Properties
Types
hooks
post: {
remove: ((...args: any[]) => Bluebird<any>)[];
save: ((...args: any[]) => Bluebird<any>)[];
};
pre: {
remove: ((...args: any[]) => Bluebird<any>)[];
save: ((...args: any[]) => Bluebird<any>)[];
};
}methods
paths
stacks
export: ((data: object) => void)[];
getter: ((data: object) => void)[];
import: ((data: object) => void)[];
setter: ((data: object) => void)[];
}statics
Static
Types Methods
add
Parameters
Returns void
method
path
Parameters
Returns default<any>
Parameters
Returns void
post
pre
Returns void
pre
static
virtual
Parameters
Rest
...args: any[]Returns void
Returns void
static
virtual
data
parameter is the
complete data.
The return value will replace the original data.
-Checks the existance of data.
-Optional
data: unknownChecks whether value
is less than or equal to (i.e. <=) the query
.
Optional
data: unknownChecks whether value
is greater than or equal to (i.e. >=) the query
.
Optional
data: unknownChecks the existance of data.
+Optional
data: unknownChecks whether value
is less than or equal to (i.e. <=) the query
.
Optional
data: unknownChecks whether value
is greater than or equal to (i.e. >=) the query
.
Optional
data: unknownChecks the equality of data.
-Optional
data: unknownChecks the equality of data. Returns true if the value doesn't match.
-Optional
data: unknown
Database constructor.
-