Is mongoexport more optimized for querying than running the same query with a driver like "mongodb" for nodejs?
Mongoexport connects to the MongoDB server using the Go driver.
Any operation it performs can also be performed by any other user.
If there is no filter provided, it will hint to use {$natural:1} to read the documents in the order they appear on disk, which is more efficient than using an index when reading the entire collection.
You should be able to discover the exact queries and options used by any particular run of mongoexport by setting slowms to 0, or by increasing the logging verbosity of the query component.
Once you know what queries it uses for your use cases, you can compare that with what you could do with your driver to determine which is more efficient.