mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
19 lines
661 B
TypeScript
19 lines
661 B
TypeScript
import BluebirdPromise = require("bluebird");
|
|
import { ICollection } from "../ICollection";
|
|
import { ICollectionFactory } from "../ICollectionFactory";
|
|
import { MongoCollection } from "./MongoCollection";
|
|
import path = require("path");
|
|
import MongoDB = require("mongodb");
|
|
import { IMongoClient } from "../../connectors/mongo/IMongoClient";
|
|
|
|
export class MongoCollectionFactory implements ICollectionFactory {
|
|
private mongoClient: IMongoClient;
|
|
|
|
constructor(mongoClient: IMongoClient) {
|
|
this.mongoClient = mongoClient;
|
|
}
|
|
|
|
build(collectionName: string): ICollection {
|
|
return new MongoCollection(this.mongoClient.collection(collectionName));
|
|
}
|
|
} |