ac-convert-json-schema-to-mongoose 0.3.4 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +190 -190
- package/LICENSE.md +21 -21
- package/README.md +92 -92
- package/dist/app.d.ts +1 -0
- package/{app.js → dist/app.js} +32 -31
- package/dist/index.d.ts +2 -0
- package/{index.js → dist/index.js} +6 -4
- package/dist/lib/json-schema.d.ts +6 -0
- package/{lib → dist/lib}/json-schema.js +108 -107
- package/dist/test/json-schema.spec.d.ts +1 -0
- package/dist/test/json-schema.spec.js +82 -0
- package/package.json +45 -37
- package/.travis.yml +0 -4
- package/app.js.map +0 -1
- package/app.ts +0 -32
- package/index.js.map +0 -1
- package/index.ts +0 -3
- package/json-schema-to-mongoose.d.ts +0 -7
- package/lib/json-schema.js.map +0 -1
- package/lib/json-schema.ts +0 -146
- package/typings/jasmine/jasmine.d.ts +0 -442
- package/typings/lodash/lodash.d.ts +0 -6427
- package/typings/mongoose/mongoose.d.ts +0 -455
- package/typings/node/node.d.ts +0 -1334
- package/typings/typings.d.ts +0 -0
@@ -1,455 +0,0 @@
|
|
1
|
-
// Type definitions for Mongoose 3.8.5
|
2
|
-
// Project: http://mongoosejs.com/
|
3
|
-
// Definitions by: horiuchi <https://github.com/horiuchi/>
|
4
|
-
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
5
|
-
|
6
|
-
///<reference path="../node/node.d.ts" />
|
7
|
-
|
8
|
-
declare module "mongoose" {
|
9
|
-
function connect(uri: string, options?: ConnectionOption, callback?: (err: any) => void): Mongoose;
|
10
|
-
function createConnection(): Connection;
|
11
|
-
function createConnection(uri: string, options?: ConnectionOption): Connection;
|
12
|
-
function createConnection(host: string, database_name: string, port?: number, options?: ConnectionOption): Connection;
|
13
|
-
function disconnect(callback?: (err?: any) => void): Mongoose;
|
14
|
-
|
15
|
-
function model<T extends Document>(name: string, schema?: Schema, collection?: string, skipInit?: boolean): Model<T>;
|
16
|
-
function modelNames(): string[];
|
17
|
-
function plugin(plugin: (schema: Schema, options?: Object) => void, options?: Object): Mongoose;
|
18
|
-
|
19
|
-
function get(key: string): any;
|
20
|
-
function set(key: string, value: any): void;
|
21
|
-
|
22
|
-
var mongo: any;
|
23
|
-
var mquery: any;
|
24
|
-
var version: string;
|
25
|
-
var connection: Connection;
|
26
|
-
|
27
|
-
export class Mongoose {
|
28
|
-
connect(uri: string, options?: ConnectionOption, callback?: (err: any) => void): Mongoose;
|
29
|
-
createConnection(): Connection;
|
30
|
-
createConnection(uri: string, options?: Object): Connection;
|
31
|
-
createConnection(host: string, database_name: string, port?: number, options?: ConnectionOption): Connection;
|
32
|
-
disconnect(callback?: (err?: any) => void): Mongoose;
|
33
|
-
get(key: string): any;
|
34
|
-
model<T extends Document>(name: string, schema?: Schema, collection?: string, skipInit?: boolean): Model<T>;
|
35
|
-
modelNames(): string[];
|
36
|
-
plugin(plugin: (schema: Schema, options?: Object) => void, options?: Object): Mongoose;
|
37
|
-
set(key: string, value: any): void;
|
38
|
-
|
39
|
-
mongo: any;
|
40
|
-
mquery: any;
|
41
|
-
version: string;
|
42
|
-
connection: Connection;
|
43
|
-
}
|
44
|
-
|
45
|
-
export interface Connection extends NodeJS.EventEmitter {
|
46
|
-
constructor(base: Mongoose): Connection;
|
47
|
-
|
48
|
-
close(callback?: (err: any) => void): Connection;
|
49
|
-
collection(name: string, options?: Object): Collection;
|
50
|
-
model<T extends Document>(name: string, schema?: Schema, collection?: string): Model<T>;
|
51
|
-
modelNames(): string[];
|
52
|
-
open(host: string, database?: string, port?: number, options?: ConnectionOption, callback?: (err: any) => void): Connection;
|
53
|
-
openSet(uris: string, database?: string, options?: ConnectionSetOption, callback?: (err: any) => void): Connection;
|
54
|
-
|
55
|
-
db: any;
|
56
|
-
collections: {[index: string]: Collection};
|
57
|
-
readyState: number;
|
58
|
-
}
|
59
|
-
export interface ConnectionOption {
|
60
|
-
db?: any;
|
61
|
-
server?: any;
|
62
|
-
replset?: any;
|
63
|
-
user?: string;
|
64
|
-
pass?: string;
|
65
|
-
auth?: any;
|
66
|
-
}
|
67
|
-
export interface ConnectionSetOption extends ConnectionOption {
|
68
|
-
mongos?: boolean;
|
69
|
-
}
|
70
|
-
|
71
|
-
export interface Collection {
|
72
|
-
}
|
73
|
-
|
74
|
-
|
75
|
-
export class SchemaType { }
|
76
|
-
export class VirtualType {
|
77
|
-
get(fn: Function): VirtualType;
|
78
|
-
set(fn: Function): VirtualType;
|
79
|
-
}
|
80
|
-
export module Types {
|
81
|
-
export class ObjectId {
|
82
|
-
toHexString(): string;
|
83
|
-
}
|
84
|
-
}
|
85
|
-
|
86
|
-
export class Schema {
|
87
|
-
static Types: {
|
88
|
-
String: String;
|
89
|
-
ObjectId: Types.ObjectId;
|
90
|
-
OId: Types.ObjectId;
|
91
|
-
Mixed: any;
|
92
|
-
};
|
93
|
-
constructor(schema?: Object, options?: Object);
|
94
|
-
|
95
|
-
add(obj: Object, prefix?: string): void;
|
96
|
-
eachPath(fn: (path: string, type: any) => void): Schema;
|
97
|
-
get(key: string): any;
|
98
|
-
index(fields: Object, options?: Object): Schema;
|
99
|
-
indexes(): void;
|
100
|
-
method(name: string, fn: Function): Schema;
|
101
|
-
method(method: Object): Schema;
|
102
|
-
path(path: string): any;
|
103
|
-
path(path: string, constructor: any): Schema;
|
104
|
-
pathType(path: string): string;
|
105
|
-
plugin(plugin: (schema: Schema, options?: Object) => void, options?: Object): Schema;
|
106
|
-
post(method: string, fn: Function): Schema;
|
107
|
-
pre(method: string, callback: Function): Schema;
|
108
|
-
requiredPaths(): string[];
|
109
|
-
set(key: string, value: any): void;
|
110
|
-
static(name: string, fn: Function): Schema;
|
111
|
-
virtual(name: string, options?: Object): VirtualType;
|
112
|
-
virtualpath(name: string): VirtualType;
|
113
|
-
}
|
114
|
-
export interface SchemaOption {
|
115
|
-
autoIndex?: boolean;
|
116
|
-
bufferCommands?: boolean;
|
117
|
-
capped?: boolean;
|
118
|
-
collection?: string;
|
119
|
-
id?: boolean;
|
120
|
-
_id?: boolean;
|
121
|
-
minimize?: boolean;
|
122
|
-
read?: string;
|
123
|
-
safe?: boolean;
|
124
|
-
shardKey?: boolean;
|
125
|
-
strict?: boolean;
|
126
|
-
toJSON?: Object;
|
127
|
-
toObject?: Object;
|
128
|
-
versionKey?: boolean;
|
129
|
-
}
|
130
|
-
|
131
|
-
export interface Model<T extends Document> {
|
132
|
-
new(doc: Object): T;
|
133
|
-
|
134
|
-
aggregate(...aggregations: Object[]): Aggregate<T[]>;
|
135
|
-
aggregate(aggregation: Object, callback: (err: any, res: T[]) => void): Promise<T[]>;
|
136
|
-
aggregate(aggregation1: Object, aggregation2: Object, callback: (err: any, res: T[]) => void): Promise<T[]>;
|
137
|
-
aggregate(aggregation1: Object, aggregation2: Object, aggregation3: Object, callback: (err: any, res: T[]) => void): Promise<T[]>;
|
138
|
-
count(conditions: Object, callback?: (err: any, count: number) => void): Query<number>;
|
139
|
-
|
140
|
-
create(doc: Object, fn?: (err: any, res: T) => void): Promise<T[]>;
|
141
|
-
create(doc1: Object, doc2: Object, fn?: (err: any, res1: T, res2: T) => void): Promise<T[]>;
|
142
|
-
create(doc1: Object, doc2: Object, doc3: Object, fn?: (err: any, res1: T, res2: T, res3: T) => void): Promise<T[]>;
|
143
|
-
discriminator<U extends Document>(name: string, schema: Schema): Model<U>;
|
144
|
-
distinct(field: string, callback?: (err: any, res: T[]) => void): Query<T[]>;
|
145
|
-
distinct(field: string, conditions: Object, callback?: (err: any, res: T[]) => void): Query<T[]>;
|
146
|
-
ensureIndexes(callback: (err: any) => void): Promise<T>;
|
147
|
-
|
148
|
-
find(cond: Object, callback?: (err: any, res: T[]) => void): Query<T[]>;
|
149
|
-
find(cond: Object, fields: Object, callback?: (err: any, res: T[]) => void): Query<T[]>;
|
150
|
-
find(cond: Object, fields: Object, options: Object, callback?: (err: any, res: T[]) => void): Query<T[]>;
|
151
|
-
findById(id: string, callback?: (err: any, res: T) => void): Query<T>;
|
152
|
-
findById(id: string, fields: Object, callback?: (err: any, res: T) => void): Query<T>;
|
153
|
-
findById(id: string, fields: Object, options: Object, callback?: (err: any, res: T) => void): Query<T>;
|
154
|
-
findByIdAndRemove(id: string, callback?: (err: any, res: T) => void): Query<T>;
|
155
|
-
findByIdAndRemove(id: string, options: Object, callback?: (err: any, res: T) => void): Query<T>;
|
156
|
-
findByIdAndUpdate(id: string, update: Object, callback?: (err: any, res: T) => void): Query<T>;
|
157
|
-
findByIdAndUpdate(id: string, update: Object, options: FindAndUpdateOption, callback?: (err: any, res: T) => void): Query<T>;
|
158
|
-
findOne(cond?: Object, callback?: (err: any, res: T) => void): Query<T>;
|
159
|
-
findOne(cond: Object, fields: Object, callback?: (err: any, res: T) => void): Query<T>;
|
160
|
-
findOne(cond: Object, fields: Object, options: Object, callback?: (err: any, res: T) => void): Query<T>;
|
161
|
-
findOneAndRemove(cond: Object, callback?: (err: any, res: T) => void): Query<T>;
|
162
|
-
findOneAndRemove(cond: Object, options: Object, callback?: (err: any, res: T) => void): Query<T>;
|
163
|
-
findOneAndUpdate(cond: Object, update: Object, callback?: (err: any, res: T) => void): Query<T>;
|
164
|
-
findOneAndUpdate(cond: Object, update: Object, options: FindAndUpdateOption, callback?: (err: any, res: T) => void): Query<T>;
|
165
|
-
|
166
|
-
geoNear(point: { type: string; coordinates: number[] }, options: Object, callback?: (err: any, res: T[]) => void): Query<T[]>;
|
167
|
-
geoNear(point: number[], options: Object, callback?: (err: any, res: T[]) => void): Query<T[]>;
|
168
|
-
geoSearch(cond: Object, options: GeoSearchOption, callback?: (err: any, res: T[]) => void): Query<T[]>;
|
169
|
-
increment(): T;
|
170
|
-
mapReduce<K, V>(options: MapReduceOption<T, K, V>, callback?: (err: any, res: MapReduceResult<K, V>[]) => void): Promise<MapReduceResult<K, V>[]>;
|
171
|
-
mapReduce<K, V>(options: MapReduceOption2<T, K, V>, callback?: (err: any, res: MapReduceResult<K, V>[]) => void): Promise<MapReduceResult<K, V>[]>;
|
172
|
-
model<U extends Document>(name: string): Model<U>;
|
173
|
-
|
174
|
-
populate<U>(doc: U, options: Object, callback?: (err: any, res: U) => void): Promise<U>;
|
175
|
-
populate<U>(doc: U[], options: Object, callback?: (err: any, res: U[]) => void): Promise<U[]>;
|
176
|
-
update(cond: Object, update: Object, callback?: (err: any, affectedRows: number, raw: any) => void): Query<T>;
|
177
|
-
update(cond: Object, update: Object, options: Object, callback?: (err: any, affectedRows: number, raw: any) => void): Query<T>;
|
178
|
-
remove(cond: Object, callback?: (err: any) => void): Query<{}>;
|
179
|
-
save(callback?: (err: any, result: T, numberAffected: number) => void): Query<T>;
|
180
|
-
where(path: string, val?: Object): Query<T[]>;
|
181
|
-
|
182
|
-
$where(argument: string): Query<T>;
|
183
|
-
$where(argument: Function): Query<T>;
|
184
|
-
|
185
|
-
base: Mongoose;
|
186
|
-
collection: Collection;
|
187
|
-
db: any;
|
188
|
-
discriminators: any;
|
189
|
-
modelName: string;
|
190
|
-
schema: Schema;
|
191
|
-
}
|
192
|
-
export interface FindAndUpdateOption {
|
193
|
-
new?: boolean;
|
194
|
-
upsert?: boolean;
|
195
|
-
sort?: Object;
|
196
|
-
select?: Object;
|
197
|
-
}
|
198
|
-
export interface GeoSearchOption {
|
199
|
-
near: number[];
|
200
|
-
maxDistance: number;
|
201
|
-
limit?: number;
|
202
|
-
lean?: boolean;
|
203
|
-
}
|
204
|
-
export interface MapReduceOption<T extends Document, Key, Val> {
|
205
|
-
map: () => void;
|
206
|
-
reduce: (key: Key, vals: T[]) => Val;
|
207
|
-
query?: Object;
|
208
|
-
limit?: number;
|
209
|
-
keeptemp?: boolean;
|
210
|
-
finalize?: (key: Key, val: Val) => Val;
|
211
|
-
scope?: Object;
|
212
|
-
jsMode?: boolean;
|
213
|
-
verbose?: boolean;
|
214
|
-
out?: {
|
215
|
-
inline?: number;
|
216
|
-
replace?: string;
|
217
|
-
reduce?: string;
|
218
|
-
merge?: string;
|
219
|
-
};
|
220
|
-
}
|
221
|
-
export interface MapReduceOption2<T extends Document, Key, Val> {
|
222
|
-
map: string;
|
223
|
-
reduce: (key: Key, vals: T[]) => Val;
|
224
|
-
query?: Object;
|
225
|
-
limit?: number;
|
226
|
-
keeptemp?: boolean;
|
227
|
-
finalize?: (key: Key, val: Val) => Val;
|
228
|
-
scope?: Object;
|
229
|
-
jsMode?: boolean;
|
230
|
-
verbose?: boolean;
|
231
|
-
out?: {
|
232
|
-
inline?: number;
|
233
|
-
replace?: string;
|
234
|
-
reduce?: string;
|
235
|
-
merge?: string;
|
236
|
-
};
|
237
|
-
}
|
238
|
-
export interface MapReduceResult<Key, Val> {
|
239
|
-
_id: Key;
|
240
|
-
value: Val;
|
241
|
-
}
|
242
|
-
|
243
|
-
export class Query<T> {
|
244
|
-
exec(callback?: (err: any, res: T) => void): Promise<T>;
|
245
|
-
exec(operation: string, callback?: (err: any, res: T) => void): Promise<T>;
|
246
|
-
exec(operation: Function, callback?: (err: any, res: T) => void): Promise<T>;
|
247
|
-
|
248
|
-
all(val: number): Query<T>;
|
249
|
-
all(path: string, val: number): Query<T>;
|
250
|
-
and(array: Object[]): Query<T>;
|
251
|
-
box(val: Object): Query<T>;
|
252
|
-
box(a: number[], b: number[]): Query<T>;
|
253
|
-
batchSize(val: number): Query<T>;
|
254
|
-
cast<U extends Document>(model: Model<U>, obj: Object): U;
|
255
|
-
//center(): Query<T>;
|
256
|
-
//centerSphere(path: string, val: Object): Query<T>;
|
257
|
-
circle(area: Object): Query<T>;
|
258
|
-
circle(path: string, area: Object): Query<T>;
|
259
|
-
comment(val: any): Query<T>;
|
260
|
-
count(callback?: (err: any, count: number) => void): Query<T>;
|
261
|
-
count(criteria: Object, callback?: (err: any, count: number) => void): Query<T>;
|
262
|
-
distinct(callback?: (err: any, res: T) => void): Query<T>;
|
263
|
-
distinct(field: string, callback?: (err: any, res: T) => void): Query<T>;
|
264
|
-
distinct(criteria: Object, field: string, callback?: (err: any, res: T) => void): Query<T>;
|
265
|
-
distinct(criteria: Query<T>, field: string, callback?: (err: any, res: T) => void): Query<T>;
|
266
|
-
elemMatch(criteria: Object): Query<T>;
|
267
|
-
elemMatch(criteria: (elem: Query<T>) => void): Query<T>;
|
268
|
-
elemMatch(path: string, criteria: Object): Query<T>;
|
269
|
-
elemMatch(path: string, criteria: (elem: Query<T>) => void): Query<T>;
|
270
|
-
equals(val: Object): Query<T>;
|
271
|
-
exists(val?: boolean): Query<T>;
|
272
|
-
exists(path: string, val?: boolean): Query<T>;
|
273
|
-
find(callback?: (err: any, res: T) => void): Query<T>;
|
274
|
-
find(criteria: Object, callback?: (err: any, res: T) => void): Query<T>;
|
275
|
-
findOne(callback?: (err: any, res: T) => void): Query<T>;
|
276
|
-
findOne(criteria: Object, callback?: (err: any, res: T) => void): Query<T>;
|
277
|
-
findOneAndRemove(callback?: (err: any, res: T) => void): Query<T>;
|
278
|
-
findOneAndRemove(cond: Object, callback?: (err: any, res: T) => void): Query<T>;
|
279
|
-
findOneAndRemove(cond: Object, options: Object, callback?: (err: any, res: T) => void): Query<T>;
|
280
|
-
findOneAndUpdate(callback?: (err: any, res: T) => void): Query<T>;
|
281
|
-
findOneAndUpdate(update: Object, callback?: (err: any, res: T) => void): Query<T>;
|
282
|
-
findOneAndUpdate(cond: Object, update: Object, callback?: (err: any, res: T) => void): Query<T>;
|
283
|
-
findOneAndUpdate(cond: Object, update: Object, options: FindAndUpdateOption, callback?: (err: any, res: T) => void): Query<T>;
|
284
|
-
geometry(object: Object): Query<T>;
|
285
|
-
gt(val: number): Query<T>;
|
286
|
-
gt(path: string, val: number): Query<T>;
|
287
|
-
gte(val: number): Query<T>;
|
288
|
-
gte(path: string, val: number): Query<T>;
|
289
|
-
hint(val: Object): Query<T>;
|
290
|
-
in(val: any[]): Query<T>;
|
291
|
-
in(path: string, val: any[]): Query<T>;
|
292
|
-
intersects(arg?: Object): Query<T>;
|
293
|
-
lean(bool?: boolean): Query<T>;
|
294
|
-
limit(val: number): Query<T>;
|
295
|
-
lt(val: number): Query<T>;
|
296
|
-
lt(path: string, val: number): Query<T>;
|
297
|
-
lte(val: number): Query<T>;
|
298
|
-
lte(path: string, val: number): Query<T>;
|
299
|
-
maxDistance(val: number): Query<T>;
|
300
|
-
maxDistance(path: string, val: number): Query<T>;
|
301
|
-
maxScan(val: number): Query<T>;
|
302
|
-
merge(source: Query<T>): Query<T>;
|
303
|
-
merge(source: Object): Query<T>;
|
304
|
-
mod(val: number[]): Query<T>;
|
305
|
-
mod(path: string, val: number[]): Query<T>;
|
306
|
-
ne(val: any): Query<T>;
|
307
|
-
ne(path: string, val: any): Query<T>;
|
308
|
-
near(val: Object): Query<T>;
|
309
|
-
near(path: string, val: Object): Query<T>;
|
310
|
-
nearSphere(val: Object): Query<T>;
|
311
|
-
nearSphere(path: string, val: Object): Query<T>;
|
312
|
-
nin(val: any[]): Query<T>;
|
313
|
-
nin(path: string, val: any[]): Query<T>;
|
314
|
-
nor(array: Object[]): Query<T>;
|
315
|
-
or(array: Object[]): Query<T>;
|
316
|
-
polygon(...coordinatePairs: number[][]): Query<T>;
|
317
|
-
polygon(path: string, ...coordinatePairs: number[][]): Query<T>;
|
318
|
-
populate(path: string, select?: string, match?: Object, options?: Object): Query<T>;
|
319
|
-
populate(path: string, select: string, model: string, match?: Object, options?: Object): Query<T>;
|
320
|
-
populate(opt: PopulateOption): Query<T>;
|
321
|
-
read(pref: string, tags?: Object[]): Query<T>;
|
322
|
-
regex(val: RegExp): Query<T>;
|
323
|
-
regex(path: string, val: RegExp): Query<T>;
|
324
|
-
remove(callback?: (err: any, res: T) => void): Query<T>;
|
325
|
-
remove(criteria: Object, callback?: (err: any, res: T) => void): Query<T>;
|
326
|
-
select(arg: string): Query<T>;
|
327
|
-
select(arg: Object): Query<T>;
|
328
|
-
setOptions(options: Object): Query<T>;
|
329
|
-
size(val: number): Query<T>;
|
330
|
-
size(path: string, val: number): Query<T>;
|
331
|
-
skip(val: number): Query<T>;
|
332
|
-
slaveOk(v?: boolean): Query<T>;
|
333
|
-
slice(val: number): Query<T>;
|
334
|
-
slice(val: number[]): Query<T>;
|
335
|
-
slice(path: string, val: number): Query<T>;
|
336
|
-
slice(path: string, val: number[]): Query<T>;
|
337
|
-
snapshot(v?: boolean): Query<T>;
|
338
|
-
sort(arg: Object): Query<T>;
|
339
|
-
sort(arg: string): Query<T>;
|
340
|
-
stream(options?: { transform?: Function; }): QueryStream;
|
341
|
-
tailable(v?: boolean): Query<T>;
|
342
|
-
toConstructor(): Query<T>;
|
343
|
-
update(callback?: (err: any, affectedRows: number, doc: T) => void): Query<T>;
|
344
|
-
update(doc: Object, callback?: (err: any, affectedRows: number, doc: T) => void): Query<T>;
|
345
|
-
update(criteria: Object, doc: Object, callback?: (err: any, affectedRows: number, doc: T) => void): Query<T>;
|
346
|
-
update(criteria: Object, doc: Object, options: Object, callback?: (err: any, affectedRows: number, doc: T) => void): Query<T>;
|
347
|
-
where(path?: string, val?: any): Query<T>;
|
348
|
-
where(path?: Object, val?: any): Query<T>;
|
349
|
-
within(val?: Object): Query<T>;
|
350
|
-
within(coordinate: number[], ...coordinatePairs: number[][]): Query<T>;
|
351
|
-
|
352
|
-
$where(argument: string): Query<T>;
|
353
|
-
$where(argument: Function): Query<T>;
|
354
|
-
|
355
|
-
static use$geoWithin: boolean;
|
356
|
-
}
|
357
|
-
|
358
|
-
export interface PopulateOption {
|
359
|
-
path: string;
|
360
|
-
select?: string;
|
361
|
-
model?: string;
|
362
|
-
match?: Object;
|
363
|
-
options?: Object;
|
364
|
-
}
|
365
|
-
|
366
|
-
export interface QueryStream extends NodeJS.EventEmitter {
|
367
|
-
destory(err?: any): void;
|
368
|
-
pause(): void;
|
369
|
-
resume(): void;
|
370
|
-
pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean; }): T;
|
371
|
-
paused: number;
|
372
|
-
readable: boolean;
|
373
|
-
}
|
374
|
-
|
375
|
-
export interface Document {
|
376
|
-
id?: string;
|
377
|
-
_id: string;
|
378
|
-
|
379
|
-
equals(doc: Document): boolean;
|
380
|
-
get(path: string, type?: new(...args: any[]) => any): any;
|
381
|
-
inspect(options?: Object): string;
|
382
|
-
invalidate(path: string, errorMsg: string, value: any): void;
|
383
|
-
invalidate(path: string, error: Error, value: any): void;
|
384
|
-
isDirectModified(path: string): boolean;
|
385
|
-
isInit(path: string): boolean;
|
386
|
-
isModified(path?: string): boolean;
|
387
|
-
isSelected(path: string): boolean;
|
388
|
-
markModified(path: string): void;
|
389
|
-
modifiedPaths(): string[];
|
390
|
-
populate<T>(callback?: (err: any, res: T) => void): Document;
|
391
|
-
populate<T>(path?: string, callback?: (err: any, res: T) => void): Document;
|
392
|
-
populate<T>(opt: PopulateOption, callback?: (err: any, res: T) => void): Document;
|
393
|
-
populated(path: string): any;
|
394
|
-
remove<T>(callback?: (err: any) => void): Query<T>;
|
395
|
-
save<T>(callback?: (err: any, res: T) => void): void;
|
396
|
-
set(path: string, val: any, type?: new(...args: any[]) => any, options?: Object): void;
|
397
|
-
set(path: string, val: any, options?: Object): void;
|
398
|
-
set(value: Object): void;
|
399
|
-
toJSON(options?: Object): Object;
|
400
|
-
toObject(options?: Object): Object;
|
401
|
-
toString(): string;
|
402
|
-
update<T>(doc: Object, options: Object, callback: (err: any, affectedRows: number, raw: any) => void): Query<T>;
|
403
|
-
validate(cb: (err: any) => void): void;
|
404
|
-
|
405
|
-
isNew: boolean;
|
406
|
-
errors: Object;
|
407
|
-
schema: Object;
|
408
|
-
}
|
409
|
-
|
410
|
-
|
411
|
-
export class Aggregate<T> {
|
412
|
-
constructor(...options: Object[]);
|
413
|
-
|
414
|
-
append(...options: Object[]): Aggregate<T>;
|
415
|
-
group(arg: Object): Aggregate<T>;
|
416
|
-
limit(num: number): Aggregate<T>;
|
417
|
-
match(arg: Object): Aggregate<T>;
|
418
|
-
near(parameters: Object): Aggregate<T>;
|
419
|
-
project(arg: string): Aggregate<T>;
|
420
|
-
project(arg: Object): Aggregate<T>;
|
421
|
-
select(filter: string): Aggregate<T>;
|
422
|
-
skip(num: number): Aggregate<T>;
|
423
|
-
sort(arg: string): Aggregate<T>;
|
424
|
-
sort(arg: Object): Aggregate<T>;
|
425
|
-
unwind(fiels: string, ...rest: string[]): Aggregate<T>;
|
426
|
-
|
427
|
-
exec(callback?: (err: any, result: T) => void): Promise<T>;
|
428
|
-
read(pref: string, ...tags: Object[]): Aggregate<T>;
|
429
|
-
}
|
430
|
-
|
431
|
-
export class Promise<T> {
|
432
|
-
constructor(fn?: (err: any, result: T) => void);
|
433
|
-
|
434
|
-
then<U>(onFulFill: (result: T) => void, onReject?: (err: any) => void): Promise<U>;
|
435
|
-
end(): void;
|
436
|
-
|
437
|
-
fulfill(result: T): Promise<T>;
|
438
|
-
reject(err: any): Promise<T>;
|
439
|
-
resolve(err: any, result: T): Promise<T>;
|
440
|
-
|
441
|
-
onFulfill(listener: (result: T) => void): Promise<T>;
|
442
|
-
onReject(listener: (err: any) => void): Promise<T>;
|
443
|
-
onResolve(listener: (err: any, result: T) => void): Promise<T>;
|
444
|
-
on(event: string, listener: Function): Promise<T>;
|
445
|
-
|
446
|
-
// Deprecated methods.
|
447
|
-
addBack(listener: (err: any, result: T) => void): Promise<T>;
|
448
|
-
addCallback(listener: (result: T) => void): Promise<T>;
|
449
|
-
addErrback(listener: (err: any) => void): Promise<T>;
|
450
|
-
complete(result: T): Promise<T>;
|
451
|
-
error(err: any): Promise<T>;
|
452
|
-
}
|
453
|
-
|
454
|
-
}
|
455
|
-
|