On 23 sep, 00:18, Sam Millman <
sam.mill...@gmail.com> wrote:
> No No, ensureIndex is the same as creating an index. It does nothing
> special, maybe the name of the function is a little odd really and should
> be called create_index instead.
>
> Since Mongo has no pre-defined schema (NoSQL) it has to create indexes a
> different way to SQL. The way proposed was through client side when the
> user decides they need an index on a particular field. This is how
> collections and what not are created, when they are used by the client.
>
> This function was called ensureIndex().
>
> So there is only one call needed to ensureIndex() within your app and it
> should be a list of fields for that index as the first param and any extra
> options (like sparse) for the second param.
>
> There is no work needed by the administrator to keep this index intact,
> well not once a month but if something fails in the cluster then yea, some
> work will be needed by the admin to possibly remake the index.
>
> I personally have a file of indexes I call everytime my app is loaded.
>
> I hope this clears things up a little,
>