Socket
Socket
Sign inDemoInstall

@arthurka/mongodb

Package Overview
Dependencies
158
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @arthurka/mongodb

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


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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();
})();

FAQs

Last updated on 18 Dec 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc