DDCODE

Share programming skills from Magic Oriental

upArrow

Mongodb queries based on _id

 May 12, 2019   mongodb, question

I convert the qualified _id into a string and store it in a collection. When querying documents, how to query documents whose objectId is not an element in the collection? $nin? $ne? The main problem is that the id is objectId, which is a bit blind.

It’s still $nin. Convert _id set to LIst<ObjectId > and implement with $nin

Related Posts:

  • How does nodejs mongodb query based on _id
  • How do I use fields other than primary key _id for…
  • How to get _id when java development mongodb returns…
  • The front-end questions everything about _id in MongoDB
  • Mongodb's _id is not available in the portal file?
  • Nodejs plus express plus mongodb custom _id self-increment.
  • Using mgo package in Golang cannot get "_id" field…
  • MongoDB: Why is it not good to modify the objectid…
  • MongoDb, how to delete data according to a certain _id value
<< MongoDB outputs MongoConnectionException at the console every ten seconds or so How does mongodb query a single subdocument >>

Related Posts:

  • How does nodejs mongodb query based on _id
  • How do I use fields other than primary key _id for…
  • How to get _id when java development mongodb returns…
  • The front-end questions everything about _id in MongoDB
  • Mongodb's _id is not available in the portal file?
  • Nodejs plus express plus mongodb custom _id self-increment.
  • Using mgo package in Golang cannot get "_id" field…
  • MongoDB: Why is it not good to modify the objectid…
  • MongoDb, how to delete data according to a certain _id value

Tags

Android android-studio apache c c++ centos Css css3 Database Docker Eclipse Express Front end git GitHub golang Html html5 Ios java javascript Jquery Laravel linux macos mongodb mysql Nginx node.js npm objective-c php Programmer python redis ruby shell Spring Sql Swift ubuntu vim vue.js Web xcode

Powered by MyWiki WordPress Theme