0.1.2 • Published 11 months ago

oc_mongo v0.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
11 months ago

App Server

  • based on mongodb

API

Dao

constructor(collectionName, { uri = process.env.MONGODB_URI } = {})

ParamDesc
collectionNameName of the collection in database.
uriUri of database in mongoDB
const OcMongo = require("oc_mongo");

class UserDao extends OcMongo.Dao {
  constructor() {
    super("user"); // name of the collection
  }

  createIndexes() {
    super.createIndex({ email: 1, password: 1 }, { unique: true });
    super.createIndex({ name: 1 });
  }
}

ENV

  • add .env file next to package.json and configure your App:
ParamDesc
MONGODB_URIUri of the mongo database.

Publishing to npmjs

npm publish --access public

0.1.2

11 months ago

0.1.1

11 months ago

0.1.0

11 months ago