fictionco / fiction

(Public Release Summer 2024) Personal Marketing Platform. A powerful platform for your online identity.

Home Page:https://www.fiction.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

  1. At startup, it is observed:
    MongoError: Index key contains an illegal field name: field name starts with '$'
    Like this #227 .
  2. 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
  3. Run command: npx factor dev
  4. Find text: http://localhost:3000/forum?search=find text

Thanks

Partially fixed in commit, MongoDB has changed something in regard to text indexes apparently.