当前位置:网站首页>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边栏推荐
- 2021-08-09
- Detailed array expansion analysis --- take you step by step analysis
- JD home programmers delete databases and run away. Talk about binlog, the killer of MySQL data backup
- Application of slice
- AI should take code agriculture? Deepmind offers a programming version of "Alpha dog" alphacode that surpasses nearly half of programmers!
- Fundamentals of software testing
- 20 kinds of hardware engineers must be aware of basic components | the latest update to 8.13
- Experiment 7. IPv6
- World document to picture
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 23
猜你喜欢
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 11
(August 9, 2021) example exercise of air quality index calculation (I)
Fundamentals of software testing
Some summaries of the 21st postgraduate entrance examination 823 of network security major of Shanghai Jiaotong University and ideas on how to prepare for the 22nd postgraduate entrance examination pr
Games101 Lesson 8 shading 2 Notes
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 10
Climb Phoenix Mountain on December 19, 2021
Detailed explanation of classic process synchronization problems
Post man JSON script version conversion
Day01 preliminary packet capture
随机推荐
Introduction of network security research direction of Shanghai Jiaotong University
Canoe: distinguish VT, VN and vteststudio from their development history
Video analysis
Usage of case when then else end statement
Replace() function
Understanding of object
2020 Summary - Magic year, magic me
Four sorts: bubble, select, insert, count
DVC use case (VI): Data Registry
If function in SQL
Ultimate bug finding method - two points
2021 annual summary - it seems that I have done everything except studying hard
本地Mysql忘记密码的修改方法(windows)[通俗易懂]
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 9
Realize cross tenant Vnet connection through azure virtual Wan
试题库管理系统–数据库设计[通俗易懂]
QQ group collection
Solaris 10 network services
SSH原理和公钥认证
本地Mysql忘记密码的修改方法(windows)