Find documents by _id

Why bother writing (and reading) about something so obvious as finding a MongoDB document by its _id? Well, it is easy to do, but is it convenient?

5 ways to find a MongoDB document by _id, faster than ever

Here's how you'd do it with your current MongoDB GUI of choice (such as Compass, Robo3T, etc.):

  1. Choose the connection, database and collection
  2. Type {_id: '602d3059be20e8435d2c5d53'} or even {_id: new ObjectID('602d3059be20e8435d2c5d53')}
  3. Submit query

There is, however, a much more convenient way to get this done. Using Mingo.io, you actually have 5 different ways.

Solution no. 1 - _id as the query

Let's assume your _id is in your clipboard. Open your collection and paste the _id into query field and submit it (or press CTRL+Enter).

Solution no. 2 - Paste & Go

Again, let's say your _id is in your clipboard and your collection is open. The Solution no. 1 can be simplified using Mingo's "Paste and Go" function: Press CTRL+G and Mingo will do the rest! You don't even have to be focused in the query field.

Solution no. 3 - Mingo's Finder

If you have your _id, you don't even have to know the collection. Use Mingo's "Finder" (press CTRL+L or open a new tab), paste the _id and choose the database to search in.

Solution no. 4 - Foreign keys

Let's say you are viewing a document containing a foreign key (_id) of a different document. Just click it. Simple as that... Mingo will sift through your DB and open the document in a new tab.

Solution no. 5 - Deep linking

The last solution is the real kicker. Mingo has its own protocol which you can use in your admin or website. Just create a link, for example: mingo://mingo/live/documents/MyCollectionName/602d3059be20e8435d2c5d53

Try Mingo now

intuitive • fast • reliable

More articles

Hidden features

7 hidden features that make Mingo so addictive

Read more
Aggregation builder

Aggregation: simplified and visualized

Read more
Compare & Sync

Compare and sync entire MongoDB databases

Read more
Indexes

Creating indexes with a breeze

Read more
Deep links

Deep linking from other apps or websites

Read more
Schema Analyzer

Analyze data structure

Read more
Human-readable dates

Querying by dates - the human way

Read more