Can a $text search perform a partial match

后端 未结 2 1322
逝去的感伤
逝去的感伤 2021-01-12 04:29

Ok, so I\'m very confused by this behavior. It seems inconsistent and strange, especially since I\'ve read that Mongo isn\'t supposed to support partial search terms in full

2条回答
  •  不知归路
    2021-01-12 04:38

    You can do partial searching in mongoose database using mongoose external library called mongoose-fuzzy-search where the search text is broken in various anagrams. for more information visit this link

    User.fuzzySearch('jo').sort({ age: -1 }).exec(function (err, users) {
          console.error(err);
          console.log(users);
    });
    

提交回复
热议问题