当前位置:网站首页>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边栏推荐
- Canoe test: two ways to create CAPL test module
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 9
- OSI seven layer model & unit
- 本地Mysql忘记密码的修改方法(windows)[通俗易懂]
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 6
- How to create a new virtual machine
- IO stream ----- open
- Customized version of cacti host template
- Heartbeat error attempted replay attack
- Simple understanding of seesion, cookies, tokens
猜你喜欢

Ternsort model integration summary
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 12](/img/b1/926d9b3d7ce9c5104f3e81974eef07.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 12

Detailed explanation of classic process synchronization problems

Notes on writing test points in mind mapping

2021-08-09

Summary of Shanghai Jiaotong University postgraduate entrance examination module firewall technology

QQ group administrators

os. Path built-in module

Ultimate bug finding method - two points
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 10](/img/89/1c2f98973b79e8d181c10d7796fbb5.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 10
随机推荐
2020 Summary - Magic year, magic me
Application of slice
Introduction to canoe automatic test system
Workplace liquor bureau must pay attention to
Common tips
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 10
Decrypt the advantages of low code and unlock efficient application development
三立期货安全么?期货开户怎么开?目前期货手续费怎么降低?
Login operation (for user name and password)
Automatic translation between Chinese and English
Take advantage of the world's sleeping gap to improve and surpass yourself -- get up early
Elevator dispatching (pairing project) ③
Detailed explanation of classic process synchronization problems
Elevator dispatching (pairing project) ②
Usage of with as
Some tips on learning database
Day01 preliminary packet capture
VPS installation virtualmin panel
Fundamentals of software testing
netstat