当前位置:网站首页>How to use the mongodb ID array to get multiple documents- How to get multiple document using array of MongoDb id?
How to use the mongodb ID array to get multiple documents- How to get multiple document using array of MongoDb id?
2022-07-04 11:39:00 【javail】
problem :
I have an array of ids and I want to get all document of them at once. I have a group id, I want to get all their documents at once .For that I am writing but it return 0 records. So , I'm writing , But it returns 0 Bar record .
How can I search using multiple Ids ? How to use multiple Id To search ?
db.getCollection('feed').find({"_id" : { "$in" : [ "55880c251df42d0466919268","55bf528e69b70ae79be35006" ]}})
I am able to get records by passing single id like I can pass a single id To get records
db.getCollection('feed').find({"_id":ObjectId("55880c251df42d0466919268")})
Solution :
Reference resources : https://stackoom.com/en/question/2BNOj边栏推荐
- Reptile learning 4 winter vacation series (3)
- Realize cross tenant Vnet connection through azure virtual Wan
- Postman advanced
- QQ one click cookie acquisition
- 2021-10-20
- Oracle11g | getting started with database. It's enough to read this 10000 word analysis
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 18
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 15
- Heartbeat报错 attempted replay attack
- Day01 preliminary packet capture
猜你喜欢
Entitas learning [iv] other common knowledge points
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 23
TCP slicing and PSH understanding
Detailed explanation of classic process synchronization problems
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 21
Review of week 278 of leetcode II
Here, the DDS tutorial you want | first experience of fastdds - source code compilation & Installation & Testing
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 9
Reptile learning 3 (winter vacation learning)
2018 meisai modeling summary +latex standard meisai template sharing
随机推荐
Data transmission in the network
VPS安装Virtualmin面板
C language compilation process
Summary of Shanghai Jiaotong University postgraduate entrance examination module firewall technology
Heartbeat启动后无反应
QQ get group member operation time
Enter the smart Park, and change begins here
DDS-YYDS
Cacti主机模板之定制版
Properties and methods of OS Library
Reptile learning 4 winter vacation series (3)
Configure SSH key to realize login free
三立期货安全么?期货开户怎么开?目前期货手续费怎么降低?
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 9
QQ group collection
Test question bank management system - database design [easy to understand]
Shift EC20 mode and switch
Elevator dispatching (pairing project) ②
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 10
Sys module