@mayajs/mongo
Advanced tools
Comparing version 0.7.1 to 0.7.2
/// <reference types="mongoose-paginate" /> | ||
import { PaginateModel, ConnectionOptions, Schema, Mongoose, Document } from "mongoose"; | ||
import { PaginateModel, Schema, Mongoose, Document } from "mongoose"; | ||
export declare type AnyDocument = Document<any, any, any>; | ||
@@ -18,3 +18,2 @@ export declare type ModelPaginate<T extends AnyDocument> = PaginateModel<T>; | ||
connectionString: string; | ||
options?: ConnectionOptions; | ||
schemas?: SchemaObject[]; | ||
@@ -21,0 +20,0 @@ } |
@@ -41,3 +41,3 @@ "use strict"; | ||
try { | ||
const instance = yield db.connect(config.connectionString, config.options); | ||
const instance = yield db.connect(config.connectionString); | ||
this.databases[name] = instance; | ||
@@ -54,5 +54,4 @@ console.log(`\x1b[32m[mayajs] ${name} is connected!\x1b[0m`); | ||
const { name } = value, rest = __rest(value, ["name"]); | ||
const options = Object.assign({ useNewUrlParser: true, useCreateIndex: true, useUnifiedTopology: true, useFindAndModify: true }, rest.options); | ||
this.databases[name] = mongoose_1.default; | ||
this.config[name] = Object.assign(Object.assign({}, rest), { options }); | ||
this.config[name] = rest; | ||
} | ||
@@ -59,0 +58,0 @@ database(name) { |
{ | ||
"name": "@mayajs/mongo", | ||
"version": "0.7.1", | ||
"version": "0.7.2", | ||
"description": "MayaJS Mongo decorators and modules", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12028
182