-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Check List
- I have already read Docs page & Troubleshooting page.
- I have already searched existing issues and they are not help to me.
- I examined error or warning messages and it's difficult to solve.
- I am using the latest version of Hexo. (run
hexo versionto check) - My Node.js is matched the required version.
Expected behavior
site.categories.datasite.tags.data
are iterable before v7
Actual behavior
https://github.com/orgs/hexojs/discussions/5355
hexo.locals.get('categories') before PR:
_Query {
data: [
_Document {
name: 'test1',
_id: 'clph3uowl0001y0vr98rqaoln',
slug: [Getter],
path: [Getter],
permalink: [Getter],
posts: [Getter],
length: [Getter]
}
],
length: 1
}after PR:
_Model {
_events: [Object: null prototype] {},
_eventsCount: 0,
_maxListeners: undefined,
name: 'Category',
_mutex: Mutex { _locked: false, _queue: [] },
data: {
clph3uy05000130vr2iwbbjgi: { name: 'test1', _id: 'clph3uy05000130vr2iwbbjgi' }
},
length: 1,
schema: Schema {
paths: {
name: [SchemaTypeString],
parent: [SchemaTypeCUID],
slug: [SchemaTypeVirtual],
path: [SchemaTypeVirtual],
permalink: [SchemaTypeVirtual],
posts: [SchemaTypeVirtual],
length: [SchemaTypeVirtual],
_id: [SchemaTypeCUID]
},
statics: {},
methods: {},
hooks: { pre: [Object], post: [Object] },
stacks: {
getter: [Array],
setter: [Array],
import: [Array],
export: [Array]
}
},
Document: [class _Document extends Document],
Query: [class _Query extends Query],
[Symbol(kCapture)]: false
}How to reproduce?
just use v7
related PR: #5119
This may affect some of the Hexo themes
Is the problem still there under Safe mode?
/
Your Node.js & npm version
No response
Your Hexo and Plugin version
No response
Your package.json
No response
Your site's _config.yml (Optional)
No response
Others
related code
Lines 297 to 299 in f5e0f92
| locals.set('categories', () => db.model('Category')); | |
| locals.set('tags', () => db.model('Tag')); |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working