Mongodb problem - Index key contains an illegal field name: field name starts with '$' AND text index required for $text query
olegs18 opened this issue · comments
Reason for this issue
- At startup, it is observed:
MongoError: Index key contains an illegal field name: field name starts with '$'
Like this #227 . - Also the search does not work in the forum and blog. The following is displayed:
text index required for $text query
LOG (console.log(conditions, options);
):
↑ Request /api/posts → postIndex(forumTopic) 0.014s Size: 0kb POST:200
conditions: {
source: 'factor',
status: 'published',
'$text': { '$search': 'find text' }
}
options: {
sort: {
pinned: 'descending',
contributedAt: 'descending',
updatedAt: 'descending'
},
limit: 29,
skip: 0,
page: 1,
order: 'latest',
time: 'all-time',
search: 'find text'
}
Steps to Reproduce - Run command:
npx factor dev
- Find text: http://localhost:3000/forum?search=find text
Thanks
Partially fixed in commit, MongoDB has changed something in regard to text indexes apparently.