Should we create indexes for the fields which are part of mongoexport command?

Pawan

I am working on a existing Java J2EE application , which is using Mongodb very extensively .

The Application has got some scripts .sh files (bash files ) which runs daily at some point of time whose responsibility is to execute mongoexport command as shown below

mongoexport --csv -o /tmp/people.csv -d school -c people -f firstName,lastName,telephone,email

My question is that , do i need to create indexes on the collection named people for the fields firstName,lastName,telephone,email

Will this add any advantage on mongodb ?? Or creating indexes on these fields is not necessary at all ??

So please let me know

Should we create indexes for the fields which are part of mongoexport command ?

Kevin

The mongoexport will run in O(N) time (with or without an index) because you're exporting all the records in the collection (e.g. requires a scan on the collection). As mentioned in a comment, indexes are only needed to speed up searching, sorting, and maybe aggregations.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Why should we create Model fields in Django for MongoDB?

Which indexes should I use for inline strings?

Mongoexport blank fields to csv

On Which Fields EnsureIndex() should Use?

Should create multiple document types or multiple indexes?

command not found: mongoexport

@Embeddable or @Entity which one should we choose

Which ubuntu server should we setup for the office?

Which header should we choose for modal dialogs?

how we decide in which node we should store document in elasticsearch?

Which part should the http calling occurred in MVC?

Which index would be used if there are multiple indexes containing the same fields?

When should we use command line arguments?

Which is the best way to encode videos into multiple resolutions in django? Should we create a single celery task or to have multiple tasks to encode?

in smarty version3 I see in folder structure we have 2 plugin directory which should use for create custom plugin function?

Do we need to create indexes for sqlite tables in android?

Why we should create default constructor

when we should create new layout in android

How can we create a 'skeleton type' of an object that we should implement?

Can we and should we create MongoID for nested objects inside document?

How can I create indexes for different combinations of fields in Firestore?

Should I create 2 indexes for the same column to speed up a join?

Which package should I choose for the convert command?

C# - Dynamically create array of which the amount of indexes are variable

How should we place fields or controls for same screen if multiple customization

Why should we change the modifiers of fields outside an inner class to final?

$lookup in aggregation Mongoose, Should we use two fields in foreignField?

Should we mention as nullable: false on t.references fields

HTML: Should we use `type="text"` in HTML text-fields?