node.js - 如何根据mongoDB中的输入数组过滤集合
问题描述
我想从输入数组中获取所有匹配的数据...
假设我的数据收集是这样的
{...others, brand: Samsung },{...others, brand: Apple },{...others, brand: Oneplus },
现在我想通过 API 主体发送条件来查询这个集合。假设我的标准是这样的,{ brand: ['Samsung,' Apple'] }
如何运行 mongo 查询,以便 mongo DB 向我返回其品牌名称存在于此 API 正文数组中的所有文档
解决方案
推荐阅读
- android - 如何在活动之间传递数据到对话框片段
- erp - OroCRM 4.1.20 与 Vagrant 一起安装,但网站无法正常工作 (http 500)
- php - 使用 PHP 脚本使用 crontab 设置多个文件
- c# - (C#) 我应该在计算中防范 Infinity/-Infinity 吗?即抛出溢出异常?
- python - 在另一个 python 文件中关闭一个 python 文件
- c++ - 编写一个只接受字面量 `0` 或字面量 `1` 作为参数的函数
- c# - 将数组转移到 main 方法
- java - 如何在 RecyclerView 的所有项目中显示此复选框?
- android-activity - 如何在活动图中表示实现接口
- spring-boot - 本地 docker 服务的 Spring Boot Kafka 连接问题