当前位置:网站首页>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边栏推荐
- Lvs+kept realizes four layers of load and high availability
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 12
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 19
- Entitas learning [3] multi context system
- 2021 annual summary - it seems that I have done everything except studying hard
- QQ get group settings
- Reptile learning 3 (winter vacation learning)
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 21
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 11
- JD home programmers delete databases and run away. Talk about binlog, the killer of MySQL data backup
猜你喜欢
Ultimate bug finding method - two points
TCP slicing and PSH understanding
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 11
Introduction to Lichuang EDA
OSI seven layer model & unit
TCP fast retransmission sack mechanism
Notes on writing test points in mind mapping
Here, the DDS tutorial you want | first experience of fastdds - source code compilation & Installation & Testing
Experiment 7. IPv6
SQL greatest() function instance detailed example
随机推荐
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 16
Elevator dispatching (pairing project) ④
Number and math classes
[Chongqing Guangdong education] National Open University spring 2019 2727 tax basis reference questions
QQ one click cookie acquisition
Btrace tells you how to debug online without restarting the JVM
(August 10, 2021) web crawler learning - Chinese University ranking directed crawler
Detailed explanation of classic process synchronization problems
Canoe: distinguish VT, VN and vteststudio from their development history
QQ get group settings
World document to picture
Replace() function
Decrypt the advantages of low code and unlock efficient application development
2021-10-20
OSI model notes
2021 annual summary - it seems that I have done everything except studying hard
Failed to configure a DataSource: ‘url‘ attribute is not specified... Bug solution
Alibaba cloud server connection intranet operation
QQ group administrators
VPS安装Virtualmin面板