@tomsd/mongodbclient 4.0.3 → 4.1.0

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.
@@ -20,8 +20,8 @@ declare class MClient {
20
20
  connect(): Promise<MongoConnection>;
21
21
  protected getConnected(): Promise<MongoConnection>;
22
22
  upsert(pobj: any): Promise<UpdateResult>;
23
- read(condition?: any, opt?: any): Promise<WithId<Document>[]>;
24
- distinct(key: string, condition?: any): Promise<any[]>;
23
+ read<T = WithId<Document>>(condition?: any, opt?: any): Promise<T[]>;
24
+ distinct<T = any>(key: string, condition?: any): Promise<T[]>;
25
25
  remove(condition: any): Promise<DeleteResult>;
26
26
  stats(): Promise<Document | null>;
27
27
  count(condition?: any): Promise<number>;
@@ -20,8 +20,8 @@ declare class MClient {
20
20
  connect(): Promise<MongoConnection>;
21
21
  protected getConnected(): Promise<MongoConnection>;
22
22
  upsert(pobj: any): Promise<UpdateResult>;
23
- read(condition?: any, opt?: any): Promise<WithId<Document>[]>;
24
- distinct(key: string, condition?: any): Promise<any[]>;
23
+ read<T = WithId<Document>>(condition?: any, opt?: any): Promise<T[]>;
24
+ distinct<T = any>(key: string, condition?: any): Promise<T[]>;
25
25
  remove(condition: any): Promise<DeleteResult>;
26
26
  stats(): Promise<Document | null>;
27
27
  count(condition?: any): Promise<number>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomsd/mongodbclient",
3
- "version": "4.0.3",
3
+ "version": "4.1.0",
4
4
  "description": "It's a handy mongodb client for easy-use.",
5
5
  "exports": {
6
6
  ".": {
@@ -16,21 +16,15 @@
16
16
  "build": "tsup",
17
17
  "lint": "biome check",
18
18
  "prepare": "husky",
19
- "start-db": "docker run --name mongodb-mongodbclient --rm -d -p 27017:27017 -e MONGO_INITDB_ROOT_USERNAME=user -e MONGO_INITDB_ROOT_PASSWORD=password mongodb/mongodb-community-server:6.0.3-ubuntu2204",
20
- "stop-db": "docker container stop mongodb-mongodbclient",
19
+ "start-db": "docker compose up -d",
20
+ "stop-db": "docker compose down",
21
21
  "serve:doc": "mdbook --serve --directory docs",
22
22
  "test": "vitest --project node",
23
23
  "test:local": "vitest --project local"
24
24
  },
25
25
  "lint-staged": {
26
- "docs/**/*.html": [
27
- "npm run lint"
28
- ],
29
- "src/**/*.ts": [
30
- "npm run lint"
31
- ],
32
- "__test__/**/*.ts": [
33
- "npm run lint"
26
+ "**/*.{js,ts}": [
27
+ "biome check"
34
28
  ]
35
29
  },
36
30
  "keywords": [
@@ -44,12 +38,12 @@
44
38
  },
45
39
  "dependencies": {
46
40
  "mongodb": "6.12.0",
47
- "uuid": "11.0.3"
41
+ "uuid": "11.0.4"
48
42
  },
49
43
  "devDependencies": {
50
44
  "@biomejs/biome": "1.9.4",
51
45
  "@tomsd/md-book": "1.3.4",
52
- "@types/node": "22.10.2",
46
+ "@types/node": "22.10.5",
53
47
  "@types/uuid": "10.0.0",
54
48
  "dotenv": "16.4.7",
55
49
  "husky": "9.1.7",