mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 17:00:55 +00:00
Merge pull request #7400 from strapi/fix/database-fixes
Fix virtual mongoose remove _v char
This commit is contained in:
commit
e25a508b2b
@ -115,11 +115,9 @@ module.exports = ({ models, target }, ctx) => {
|
||||
|
||||
// Add virtual key to provide populate and reverse populate
|
||||
_.forEach(
|
||||
_.pickBy(definition.loadedModel, model => {
|
||||
return model.type === 'virtual';
|
||||
}),
|
||||
_.pickBy(definition.loadedModel, ({ type }) => type === 'virtual'),
|
||||
(value, key) => {
|
||||
schema.virtual(key.replace('_v', ''), {
|
||||
schema.virtual(key, {
|
||||
ref: value.ref,
|
||||
localField: '_id',
|
||||
foreignField: value.via,
|
||||
|
Loading…
x
Reference in New Issue
Block a user