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

tb-schema

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tb-schema

Teambition Core Schema ====================== 引用此项目并作为一个基础Teambition Schema库.

  • 1.19.12
  • unpublished
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Teambition Core Schema

引用此项目并作为一个基础Teambition Schema库.

Usage

'use strict'
var limbo = require('limbo')
var mongoose = require('mongoose')
var tbSchema = require('tb-schema')

var DB_URL = 'mongodb://root:root@192.168.0.21:27017/teambition?replicaSet=rs0'
var options = {
  auth: {
    authdb: 'admin'
  }
}

mongoose.connect(DB_URL, options)
var db = limbo.use('teambition', {
  provider: 'mongo',
  conn: mongoose.connection
})

var schemas = tbSchema.schemas(mongoose.Schema)
db.loadSchemas(schemas)
module.exports = db

API

schemas(Schema)

return all schemas that instanceof Schema.

var schemas = tbSchema.schemas(mongoose.Schema)
var userSchema = schemas.user

getSchema(Schema, name)

return base schemas that instanceof Schema.

var userSchema = tbSchema.getSchema(mongoose.Schema, 'user')

FAQs

Package last updated on 02 Aug 2019

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