mongodb-stitch
Version:
[](https://gitter.im/mongodb/stitch?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
35 lines (34 loc) • 1.99 kB
TypeScript
import { Codec, CoreStitchServiceClient, Stream } from "mongodb-stitch-core-sdk";
import ChangeEvent from "../ChangeEvent";
import RemoteCountOptions from "../RemoteCountOptions";
import RemoteDeleteResult from "../RemoteDeleteResult";
import RemoteFindOptions from "../RemoteFindOptions";
import RemoteInsertManyResult from "../RemoteInsertManyResult";
import RemoteInsertOneResult from "../RemoteInsertOneResult";
import RemoteUpdateOptions from "../RemoteUpdateOptions";
import RemoteUpdateResult from "../RemoteUpdateResult";
import CoreRemoteMongoCollection from "./CoreRemoteMongoCollection";
import CoreRemoteMongoReadOperation from "./CoreRemoteMongoReadOperation";
export default class CoreRemoteMongoCollectionImpl<T> implements CoreRemoteMongoCollection<T> {
readonly name: string;
readonly databaseName: string;
private readonly service;
private readonly codec?;
readonly namespace: string;
private readonly baseOperationArgs;
constructor(name: string, databaseName: string, service: CoreStitchServiceClient, codec?: Codec<T> | undefined);
withCollectionType<U>(codec: Codec<U>): CoreRemoteMongoCollection<U>;
find(filter?: object, options?: RemoteFindOptions): CoreRemoteMongoReadOperation<T>;
aggregate(pipeline: object[]): CoreRemoteMongoReadOperation<T>;
count(query?: object, options?: RemoteCountOptions): Promise<number>;
insertOne(value: T): Promise<RemoteInsertOneResult>;
insertMany(docs: T[]): Promise<RemoteInsertManyResult>;
deleteOne(query: object): Promise<RemoteDeleteResult>;
deleteMany(query: object): Promise<RemoteDeleteResult>;
updateOne(query: object, update: object, options?: RemoteUpdateOptions): Promise<RemoteUpdateResult>;
updateMany(query: object, update: object, options?: RemoteUpdateOptions): Promise<RemoteUpdateResult>;
watch(ids: any[]): Promise<Stream<ChangeEvent<T>>>;
private executeDelete;
private executeUpdate;
private generateObjectIdIfMissing;
}