fix(db-mongodb): joins with singular collection name (#8933)

### What?
Properly specifies `$lookup.from` when the collection name is singular.

### Why?
MongoDB can pluralize the collection name and so can be different for
singular ones.

### How?
Uses the collection name from the driver directly
`adapter.collections[slug].collection.name` instead of just `slug`.
This commit is contained in:
Sasha
2024-10-30 18:06:03 +02:00
committed by GitHub
parent 123125185c
commit f4041ce6e2
6 changed files with 62 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ import { buildConfigWithDefaults } from '../buildConfigWithDefaults.js'
import { Categories } from './collections/Categories.js'
import { CategoriesVersions } from './collections/CategoriesVersions.js'
import { Posts } from './collections/Posts.js'
import { Singular } from './collections/Singular.js'
import { Uploads } from './collections/Uploads.js'
import { Versions } from './collections/Versions.js'
import { seed } from './seed.js'
@@ -20,6 +21,7 @@ export default buildConfigWithDefaults({
Uploads,
Versions,
CategoriesVersions,
Singular,
{
slug: localizedPostsSlug,
admin: {