Creating index after inserting datas

Hi , suppose I have a thousand data in my example collection then if I create an index after that point , would this new index that comes afterhand affect prior datas that were taking place in the collection ?

No. Indexes do not modify data. The creation of a unique index will fail if your data has duplicate values on the indexed field.

I mean , can I use this new index on old datas I have inserted beforehand ?

it is not a unique index btw

Yes the existing documents will be indexed.

Refer to the following for more details.