-
Notifications
You must be signed in to change notification settings - Fork 0
/
mongodb.ts
33 lines (27 loc) · 1.06 KB
/
mongodb.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
///<reference path='./nodelib/node.d.ts' />
declare module "mongodb" {
export class Server {
constructor(host: string, port: number, opts?: any, moreopts?: any);
}
export class Db {
constructor(databaseName: string, serverConfig: Server, config : any);
public open(callback: ()=>void);
public collection(name: string, callback: (err: any, collection: MongoCollection) => void);
}
export class ObjectID {
constructor(s: string);
}
}
interface MongoDb {
}
interface MongoCollection {
find(query: any): MongoCursor;
find(query: any, callback?: (err: any, result: any) => void): MongoCursor;
find(query: any, select: any, callback?: (err: any, result: any) => void): MongoCursor;
findOne(query: any, callback: (err: any, result: any) => void): void;
update(query: any, updates: any, callback: (err: any, result: any) => void): void;
insert(query: any, options?: { }, callback?: (err: any, result: any) => void): void;
}
interface MongoCursor {
toArray(callback: (err: any, results: any[]) => void);
}