Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-1373

Text search query stopped working after driver 3 update

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:

      Hi ,
      This is my query. It started giving an error after mongo driver update. I am getting "MongoError: Can't canonicalize query: BadValue must have $meta projection for all $meta sort keys"

      My query

      dbconnectionManager.getConnection().collection('abc').find({
              $text: {$search: searchText}},{score: {$meta: "textScore"}})
                  .sort({score:{$meta:"textScore"}
                 }).toArray(function(err, result) {
                  if (err) {
                      console.error("Error occurred while fetching by text." + err);
                      callback(err, null);
                  } else {
                      callback(null, result);
                  }
              });
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            rsuryawanshi@onenetwork.com Ravi Suryawanshi
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: