@uon/model-mongo
TypeScript icon, indicating that this package has built-in type declarations

0.9.1 • Public • Published

UON model-mongo

MongoDB interface for @uon/model

Install

npm i @uon/model-mongo

Usage

import { Client as MongoClient } from '@uon/model-mongo';

// create a mongo client
let client = new MongoClient('mongodb://localhost:27017/my_database', {/* mongo options */});

// before we can use the client we need to connect
await client.connect();

// fetch on document by id
let my_doc = await client.findOne(MyModel, { id: '1234567890' });

Readme

Keywords

Package Sidebar

Install

npm i @uon/model-mongo

Weekly Downloads

1

Version

0.9.1

License

MIT

Unpacked Size

106 kB

Total Files

23

Last publish

Collaborators

  • uon-io