Socket
Socket
Sign inDemoInstall

mongo-collections

Package Overview
Dependencies
18
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mongo-collections

AMQP wrapper with promises


Version published
Weekly downloads
4
Maintainers
1
Created
Weekly downloads
 

Readme

Source

MongoDB collections

Harmonizes MongoDB usage in application.

Create own collection

import {DatabaseCollection, MongoDatabaseClient} from 'mongo-collections';

export default class ImageCollection extends DatabaseCollection {
    constructor(client: MongoDatabaseClient) {
        super('images', client);
    }
}

Insert into collection

const dbCollection = await collection.get()
    .then((dbCollection) => {
        const object = {
            src: "/img/foo.png",
            alt: "Foo image"
        };
        return dbCollection.insertOne(object);
    });

Keywords

FAQs

Last updated on 28 Oct 2018

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