@dnax/core 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/driver/mongo/connect.ts +4 -1
- package/package.json +1 -1
- package/types/index.ts +2 -1
package/driver/mongo/connect.ts
CHANGED
|
@@ -5,7 +5,10 @@ import { consola } from "consola";
|
|
|
5
5
|
async function connectToMongo(t: Tenant) {
|
|
6
6
|
return new Promise(async (resolve, reject) => {
|
|
7
7
|
let client = new MongoClient(
|
|
8
|
-
t?.database?.uri || "mongodb://localhost:27017"
|
|
8
|
+
t?.database?.uri || "mongodb://localhost:27017",
|
|
9
|
+
{
|
|
10
|
+
...(t?.database?.options || {}),
|
|
11
|
+
}
|
|
9
12
|
);
|
|
10
13
|
await client
|
|
11
14
|
.connect()
|
package/package.json
CHANGED
package/types/index.ts
CHANGED
|
@@ -17,7 +17,7 @@ import type {
|
|
|
17
17
|
updateParams,
|
|
18
18
|
} from "../driver/mongo/@types";
|
|
19
19
|
import type { RouterRoute } from "hono/types";
|
|
20
|
-
|
|
20
|
+
import type { MongoClientOptions } from "mongodb";
|
|
21
21
|
export type Socket = {
|
|
22
22
|
enabled: boolean;
|
|
23
23
|
handler: (ctx: { rest: useRest; io: Io; session: sessionCtx }) => void;
|
|
@@ -37,6 +37,7 @@ export type Tenant = {
|
|
|
37
37
|
client?: InstanceType<typeof MongoClient>;
|
|
38
38
|
db?: Db;
|
|
39
39
|
isConnected?: boolean;
|
|
40
|
+
options?: MongoClientOptions;
|
|
40
41
|
};
|
|
41
42
|
};
|
|
42
43
|
export type Actions =
|