# mongo-collections

> AMQP wrapper with promises

Latest version **1.0.3** (published 2018-10-28) · 0BSD license · 0 weekly downloads

## Install

```sh
npm install mongo-collections
pnpm add mongo-collections
yarn add mongo-collections
bun add mongo-collections
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2018-10-28 |
| First published | 2018-10-12 |
| Weekly downloads | 0 |
| License | 0BSD |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 8.9.0 |
| Dependencies | 2 |
| Unpacked size | 56.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Uldis Jansons |
| Maintainers | saleniex |
| Keywords | nosql, database |

## Links

- npm: https://www.npmjs.com/package/mongo-collections
- Repository: https://github.com/saleniex/mongo-collections
- Homepage: https://github.com/saleniex/mongo-collections#readme
- Issues: https://github.com/saleniex/mongo-collections/issues
- npm.io page: https://npm.io/package/mongo-collections

## Dependencies (2)

- [tslib](https://npm.io/package/tslib.md) ^1.9.3
- [mongodb](https://npm.io/package/mongodb.md) ^3.1.8

## Alternatives

- [@libsql/sqlite3](https://npm.io/package/@libsql/sqlite3.md) — 39.8K weekly downloads
- [@fortemi/core](https://npm.io/package/@fortemi/core.md) — 461 weekly downloads
- [cdb-converter](https://npm.io/package/cdb-converter.md) — 341 weekly downloads
- [@uplo/adapter-prisma](https://npm.io/package/@uplo/adapter-prisma.md) — 75 weekly downloads
- [typeorm-aios](https://npm.io/package/typeorm-aios.md) — 30 weekly downloads

## Recent versions

- 1.0.3 (latest) — 2018-10-28
- 1.0.2 — 2018-10-17
- 1.0.1 — 2018-10-12
- 1.0.0 — 2018-10-12

## README

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

```

---
_Source: https://npm.io/package/mongo-collections · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
