Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-55022

UnhandledPromiseRejectionWarning: MongoError: FieldPath field names may not start with '$'.

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • None
    • Server Triage

      Post.search = function (searchTerm) {
          return new Promise(function (resolve, reject) {

              if (typeof (searchTerm) == "string") {
                  let posts = Post.reusablePostQuery(
                      [
                          { $match: { $text: 

      { $search: searchTerm}

       } },
                          { $sort: { score: 

      { $meta: "textScore" }

       } },
                      ]
                  )

                  resolve(posts)

              }

              else 

      {             reject()         }

          })

      }
       
      I am getting error i am not able to retrieve the data from mongoDB Atlas

            Assignee:
            backlog-server-triage [HELP ONLY] Backlog - Triage Team
            Reporter:
            sharath.gk12@gmail.com sharath gk
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: