@uon/model-mongo
v0.9.1
Published
A mongodb client adapter for @uon/model
Downloads
6
Readme
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' });