Compare commits
No commits in common. "fc8eb81ffe9abc8f72e024f3170d1cdade6d11f7" and "5cf42e538c1bfcd3fc8aa4ffaecbebdc1b95f7a2" have entirely different histories.
fc8eb81ffe
...
5cf42e538c
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@navy.gif/wrappers",
|
"name": "@navy.gif/wrappers",
|
||||||
"version": "1.3.0",
|
"version": "1.2.2",
|
||||||
"description": "Various wrapper classes I use in my projects",
|
"description": "Various wrapper classes I use in my projects",
|
||||||
"repository": "https://git.corgi.wtf/Navy.gif/wrappers.git",
|
"repository": "https://git.corgi.wtf/Navy.gif/wrappers.git",
|
||||||
"author": "Navy.gif",
|
"author": "Navy.gif",
|
||||||
|
@ -15,9 +15,9 @@ type Credentials = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export type MariaOptions = {
|
export type MariaOptions = {
|
||||||
load?: boolean,
|
load: boolean,
|
||||||
cluster?: PoolClusterConfig,
|
cluster: PoolClusterConfig,
|
||||||
client?: PoolConfig,
|
client: PoolConfig,
|
||||||
credentials: Credentials,
|
credentials: Credentials,
|
||||||
loggerOptions?: LoggerClientOptions
|
loggerOptions?: LoggerClientOptions
|
||||||
}
|
}
|
||||||
|
@ -14,9 +14,8 @@ type Credentials = {
|
|||||||
|
|
||||||
export type MongoOptions = {
|
export type MongoOptions = {
|
||||||
credentials: Credentials,
|
credentials: Credentials,
|
||||||
loggerOptions?: LoggerClientOptions,
|
loggerOptions: LoggerClientOptions,
|
||||||
client: MongoClientOptions,
|
client: MongoClientOptions
|
||||||
load?: boolean
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -91,9 +90,6 @@ class MongoDB {
|
|||||||
*/
|
*/
|
||||||
async init () {
|
async init () {
|
||||||
|
|
||||||
if (this.#config.load)
|
|
||||||
return this.#logger.info('Not loading MongoDB');
|
|
||||||
|
|
||||||
this.#logger.status(`Initializing database connection to ${this.#_client.options.hosts}`);
|
this.#logger.status(`Initializing database connection to ${this.#_client.options.hosts}`);
|
||||||
|
|
||||||
await this.#_client.connect();
|
await this.#_client.connect();
|
||||||
@ -311,17 +307,17 @@ class MongoDB {
|
|||||||
await this.#db.collection(collection).createIndex(indices);
|
await this.#db.collection(collection).createIndex(indices);
|
||||||
}
|
}
|
||||||
|
|
||||||
// async getKey (key: string, collection = 'memoryStore') {
|
async getKey (key: string, collection = 'memoryStore') {
|
||||||
// const response = await this.findOne(collection, { key });
|
const response = await this.findOne(collection, { key });
|
||||||
// if (response)
|
if (response)
|
||||||
// return response.value;
|
return response.value;
|
||||||
// return null;
|
return null;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// async setKey (key: string, value: object, collection = 'memoryStore') {
|
async setKey (key: string, value: object, collection = 'memoryStore') {
|
||||||
// await this.updateOne(collection, { key }, { value }, true);
|
await this.updateOne(collection, { key }, { value }, true);
|
||||||
// return value;
|
return value;
|
||||||
// }
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user