【问题标题】:How i can query one part of a text and get it all using mongoose?我如何查询文本的一部分并使用猫鼬获取全部内容?
【发布时间】:2019-12-14 23:49:52
【问题描述】:
Cliente.find({name: "Douglas"},(err,clientes)=>{

如果名称中包含“Douglas”,我如何执行此操作以返回所有结果?

【问题讨论】:

  • 您可以使用answer中描述的文本索引

标签: mongodb mongoose


【解决方案1】:
Cliente.find({ name: { "$regex": "Douglas", "$options": "i" }},(err,clientes)=>{

我也发现了这个。它对我有用。

【讨论】:

    猜你喜欢
    • 2023-04-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-21
    • 2013-04-16
    • 1970-01-01
    • 1970-01-01
    • 2012-05-26
    相关资源
    最近更新 更多