🚀 Socket Launch Week Day 4:Socket MCP Adds Org Alerts, Threat Feed Review, and Package Inspection.Learn more
Sign In

loopback-objectid-mixin

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loopback-objectid-mixin

Sets objectId type for model property

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
26
44.44%
Maintainers
1
Weekly downloads
 
Created
Source

loopback-objectid-mixin

This module is designed for the Strongloop Loopback framework. It sets objectId type for model properties.

works only with loopback-connector-mongodb

install

  npm install --save loopback-objectid-mixin

mixinsources

Add the mixins property to your server/model-config.json like the following:

{
  "_meta": {
    "sources": [
      "loopback/common/models",
      "loopback/server/models",
      "../common/models",
      "./models"
    ],
    "mixins": [
      "loopback/common/mixins",
      "../node_modules/loopback-objectid-mixin",
      "../common/mixins"
    ]
  }
}

config

To use with your Models add the mixins attribute to the definition object of your model config.

  {
    "name": "Product",
    "properties": {},
    "mixins": {
      "ObjectidType": {
         "properties": ["userId"]
       }
    }
  }

options

optiontypedescriptionrequired
properties[String]properties which you want to set objectId typetrue

Keywords

mixin

FAQs

Package last updated on 01 Dec 2016

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