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:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user