
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
base-schema
Advanced tools

:smile: mongoose base schema simply
created_at updated_at and manage them_id __v fields from output jsonpage method for pagingnpm i base-schema -S
const Schema = require('base-schema')
const Foo = Schema('Foo', {
name: String
})
await Foo.create({ name: 'foo' })
await Foo.find({}).page(1, 10)
| name | ref | description |
|---|---|---|
Schema.ObjectId | mongoose.Schema.Types.ObjectId | A ref to mongoose.Schema.Types.ObjectId |
Schema.Int32 | mongoose.Schema.Types.Int32 | A ref to mongoose-int32 module |
Schema.Decimal128 | mongoose.Schema.Types.Decimal128 | A ref to mongoose.Schema.Types.Decimal128 |
Schema.Double | mongoose.Schema.Types.Double | A ref to @mongoosejs/double module |
| name | ref | description |
|---|---|---|
phone | Schema.Field.phone | add the phone and used_phones fields to Shema |
password | Schema.Field.password | add the password field and the compwd method to Shema |
const { phone, password } = Schema.Field
const User = Schema('User', { phone: phone, password: password })
const user = await User.create({
phone: '13812345678',
password: '@lili520'
})
// user.phone = '13812345678'
// user.used_phones = ['13812345678']
// user.password = hash
// await user.compwd('@lili520') is true
// await User.findOne().select('+password +used_phones')
// password and used_phones default no select
const A = Schema('A', {
name: String
})
const B = Schema('B', {
name: String,
a: {
type: Schema.ObjectId,
ref: 'A'
}
})
// origin {a: new mongoose.Types.Object('5cf8e018e5fd67512487be2e')}
await B.aggregate().match({ a: Schema.Id('5cf8e018e5fd67512487be2e') })
npm test
FAQs
a base schema for mongoose
The npm package base-schema receives a total of 14 weekly downloads. As such, base-schema popularity was classified as not popular.
We found that base-schema demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.