Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@payloadcms/db-mongodb
Advanced tools
Official MongoDB adapter for Payload.
npm install @payloadcms/db-mongodb
import { buildConfig } from 'payload/config'
import { mongooseAdapter } from '@payloadcms/db-mongodb'
export default buildConfig({
db: mongooseAdapter({
url: process.env.DATABASE_URI,
}),
// ...rest of config
})
More detailed usage can be found in the Payload Docs.
1.2.0 (2022-11-18)
You might need to update your config. This change affects collections
, globals
and block fields
with custom labeling.
Collections: are affected if you have a custom labels.singular
defined that differs from your collection slug.
// ExampleCollection.ts
// Before
const ExampleCollection: CollectionConfig = {
slug: 'case-studies',
labels: {
// Before Payload used `labels.singular` to generate types/graphQL schema
singular: 'Project',
plural: 'Projects',
},
}
// After
const ExampleCollection: CollectionConfig = {
// Now Payload uses `slug` to generate types/graphQL schema
slug: 'case-studies',
labels: {
singular: 'Project',
plural: 'Projects',
},
// To override the usage of slug in graphQL schema generation
graphQL: {
singularName: 'Project',
pluralName: 'Projects',
},
// To override the usage of slug in type file generation
typescript: {
interface: 'Project',
},
}
Globals: are affected if you have a label
defined that differs from your global slug.
// ExampleGlobal.ts
// Before
const ExampleGlobal: GlobalConfig = {
slug: 'footer',
// Before Payload used `label` to generate types/graphQL schema
label: 'Page Footer',
}
// After
const ExampleGlobal: GlobalConfig = {
// Now Payload uses `slug` to generate types/graphQL schema
slug: 'footer',
label: 'Page Footer',
// To override the usage of slug in graphQL schema generation
graphQL: {
name: 'PageFooter',
},
// To override the usage of slug in type file generation
typescript: {
interface: 'PageFooter',
},
}
Block Fields: are affected if you have a label
defined that differs from your block slug.
// ExampleBlock.ts
// Before
const ExampleBlock: Block = {
slug: 'content',
// Before Payload used `label` to generate graphQL schema
label: 'Content Block',
}
// After
const ExampleBlock: Block = {
// Now Payload uses `slug` to generate graphQL schema
slug: 'content',
label: 'Content Block',
// To override the usage of slug in graphQL schema generation
graphQL: {
singularName: 'ContentBlock',
},
}
```
**Breaking changes recap**:
On Collections
graphQL.singularName
, graphQL.pluralName
for GraphQL schema names.typescript.interface
for typescript generation name.On Globals
graphQL.name
for GraphQL Schema name.typescript.interface
for typescript generation name.On Blocks (within Block fields)
graphQL.singularName
for graphQL schema names.FAQs
The officially supported MongoDB database adapter for Payload
The npm package @payloadcms/db-mongodb receives a total of 4,292 weekly downloads. As such, @payloadcms/db-mongodb popularity was classified as popular.
We found that @payloadcms/db-mongodb demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.