A
A
Alexander risok2021-05-26 09:57:24
MongoDB
Alexander risok, 2021-05-26 09:57:24

How to get only _id of documents by mongodb filter?

I only know two methods, but what else are there, and which are faster?

distinct('_id', query)
find(query).select('_id')

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question