Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

coreio-mongodb

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coreio-mongodb

MongoDB integration for CoreIO

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-20%
Maintainers
1
Weekly downloads
 
Created
Source

coreio-mongodb

npm npm license npm downloads build status

MongoDB integration for CoreIO

Install via npm

$ npm install coreio-mongodb
import CoreIO from 'coreio';
import MongoDBService from 'coreio-mongodb';

// set db conf
CoreIO.setConf('mongodb', 'mongodb://localhost:27017/coreio-test');

const TodoModel = CoreIO.createModel('todo', {
  schema: {
    title: { type: 'string', min: 5, max: 100, required: true },
    content: { type: 'string', min: 0, max: 5000 },
    state: { type: 'number', default: 1 }
  },
  service: MongoDBService
});

export default TodoModel;

Import the model in your app, store data and save the model into a MongoDB

import TodoModel from '../path/to/model';

const model = new TodoModel();
model.set({
  title: 'Test model',
  content: 'This is a test content'
});

model.save().then((res) => {
  console.log('Item inserted with id', res.id);
});

Keywords

FAQs

Package last updated on 01 Mar 2017

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc