2.2.1 • Published 1 year ago

@arthurka/mongodb v2.2.1

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

tsconfig.json

{
  "include": [
    "node_modules/@arthurka/mongodb/build/modules.d.ts",
  ],
  "exclude": [
    // no "node_modules",
  ],
}

.env

MONGO_URL = mongodb://localhost:27017/<DB_NAME>

Or

MONGO_URL = mongodb://localhost:27017
DB_NAME = <DB_NAME>

Usage

import { getDBCollection, closeDB } from '@arthurka/mongodb';

(async () => {
  const collection = await getDBCollection('collection');

  await closeDB();
})();

Or

import { getDBCollection, closeDB } from '@arthurka/mongodb';

interface Document {
  name: string;
  age: number;
}

(async () => {
  const collection = await getDBCollection<Document>('collection');

  await closeDB();
})();
2.2.1

1 year ago

2.2.0

3 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago