///
import { AggregationQuery, MongoCommandResult, MongoDocument, MongoDocumentLike, ObjectId } from './MongoTypes';
import { MongoClient } from './MongoClient';
import { MapFunction, ReduceFunction } from './MongoClientFunctions/mapReduce';
import ReadableStream = NodeJS.ReadableStream;
export interface MongoModelConstructor {
new (): any;
getType(): string;
}
export declare abstract class MongoModel implements MongoDocument {
_id: ObjectId;
static getType(): string;
getType(): string;
}
export declare class MongoCollection {
protected db: MongoDatabase;
protected account: string;
protected module: string;
protected moduleType: any;
constructor(db: MongoDatabase, modelOrType: MongoModel | MongoModelConstructor, collection?: string);
createOne(id?: ObjectId | string): T;
createOneWithSequenceId(sparse?: boolean): Promise;
nextSequenceId(sparse?: boolean): Promise;
increase(filter: MongoDocumentLike, key: string, count?: number): Promise;
insertOne(document: MongoDocumentLike): Promise;
insertMany(documents: Array): Promise>;
upsertOne(document: MongoDocumentLike): Promise;
updateOneById(id: string | ObjectId, document: MongoDocumentLike): Promise;
updateOne(document: MongoDocumentLike): Promise;
updateMany(updates: Array): Promise;
findOneAndUpsert(filter: any, update: any, fields?: any, sort?: any): Promise;
findOneAndUpdate(filter: any, update: any, fields?: any, sort?: any): Promise;
findOneAndDelete(filter: any): Promise;
findOneById(id: string | ObjectId, projection?: any): Promise;
findOne(filter: any, projection?: any, sort?: any): Promise;
find(filter?: any, projection?: any, sort?: any, skip?: number, limit?: number): Promise>;
aggregation(query: AggregationQuery, options?: any): Promise>;
aggregate(pipeline: Array, options?: any): ReadableStream;
count(filter?: any, skip?: number, limit?: number): Promise;
distinct(key: string, filter?: any): Promise>;
mapReduce- (map: MapFunction, reduce: ReduceFunction
- , filter?: any, options?: any): Promise;
geoNear(near: [number, number], filter?: any, limit?: number, options?: any): Promise;
geoNearSpherical(near: [number, number], filter?: any, limit?: number, options?: any): Promise;
deleteOneById(id: string | ObjectId): Promise;
deleteOne(filter: any): Promise;
deleteMany(documents: Array): Promise>;
createIndex(indexes: Array): Promise;
listIndex(): Promise;
dropIndex(index: string): Promise;
touch(): Promise;
createCollection(config: any): Promise;
dropCollection(): Promise;
stats(): Promise;
run(command: any): Promise;
wrap(doc: MongoDocument | null): T | null;
wrapArray(docs: Array): Array;
}
export declare class MongoDatabase {
client: MongoClient;
account: string;
constructor(shell: MongoClient, account: string);
collections(): Promise;
stats(): Promise;
createView(view: string, config: any): Promise;
dropView(view: string): Promise;
}