Socket
Socket
Sign inDemoInstall

@fdebijl/mog

Package Overview
Dependencies
24
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fdebijl/mog

Opionated mini-ODM and collection of MongoDB utils 🔧


Version published
Maintainers
1
Weekly downloads
11
decreased by-63.33%

Weekly downloads

Readme

Source

Mog

Opionated mini-ODM and collection of MongoDB utils. Mostly for use in my own projects but you might find it useful as a boilerplate ODM for small projects.

Installation:

npm install -S @fdebijl/mog

Usage:

Recommended usage is to have a file that exports a single instance of mog for use across an entire project. Simply import the configured instance of Mog in other files to use any of the exposed operations.

// mog.ts
import { Mog } from '@fdebijl/mog';

export const mog = new Mog({
  url: 'mongodb://mongodb0.example.com:27017',
  db: 'sample',
  appName: 'Sample app',
  defaultCollection: 'users'
});

// other-file.ts
import { mog } from './mog';

const user = await mog.get<User>({id: '125919258'});

FAQs

Last updated on 26 Mar 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