/** * @fileoverview BrightDB collection adapter implementing ICollection. * Wraps a @brightchain/db Collection to conform to the shared ICollection * interface from @digitaldefiance/suite-core-lib. * Parallel to upstream's MongooseCollection. * * @module services/bright-db-collection */ import type { Collection } from '@brightchain/db'; import type { AggregationStage, BsonDocument, BulkWriteOperation, BulkWriteOptions, BulkWriteResult, ChangeListener, CollectionSchema, DeleteResult, DocumentId, FilterQuery, FindOptions, ICollection, IndexOptions, IndexSpec, InsertManyResult, InsertOneResult, ReadPreference, ReplaceResult, TextIndexOptions, UpdateOptions, UpdateQuery, UpdateResult, ValidationFieldError, WriteConcern, WriteOptions } from '@digitaldefiance/suite-core-lib'; /** * Adapts a @brightchain/db Collection to the ICollection interface. * Delegates all operations to the underlying BrightDB collection. */ export declare class BrightDbCollection implements ICollection { private readonly _collection; constructor(_collection: Collection); insertOne(doc: T, options?: WriteOptions): Promise; insertMany(docs: T[], options?: WriteOptions): Promise; findOne(filter?: FilterQuery, options?: FindOptions): Promise; find(filter?: FilterQuery, options?: FindOptions): T[] | PromiseLike; findById(id: DocumentId): Promise; updateOne(filter: FilterQuery, update: UpdateQuery, options?: UpdateOptions): Promise; updateMany(filter: FilterQuery, update: UpdateQuery, options?: UpdateOptions): Promise; deleteOne(filter: FilterQuery, options?: WriteOptions): Promise; deleteMany(filter: FilterQuery, options?: WriteOptions): Promise; replaceOne(filter: FilterQuery, doc: T, options?: UpdateOptions): Promise; countDocuments(filter?: FilterQuery): Promise; estimatedDocumentCount(): Promise; distinct(field: K, filter?: FilterQuery): Promise>; aggregate(pipeline: AggregationStage[]): Promise; createIndex(spec: IndexSpec, options?: IndexOptions): Promise; dropIndex(name: string): Promise; listIndexes(): Promise; bulkWrite(operations: BulkWriteOperation[], options?: BulkWriteOptions): Promise; watch(listener: ChangeListener): () => void; setSchema(schema: CollectionSchema): void; getSchema(): CollectionSchema | undefined; removeSchema(): void; validateDoc(doc: T): ValidationFieldError[]; getWriteConcern(): WriteConcern; setWriteConcern(wc: WriteConcern): void; getReadPreference(): ReadPreference; setReadPreference(rp: ReadPreference): void; createTextIndex(options: TextIndexOptions): string; dropTextIndex(): void; hasTextIndex(): boolean; drop(): Promise; } //# sourceMappingURL=bright-db-collection.d.ts.map