Simple: Don't create the index in the schema file. That will run every time you start your server and give the error you're seeing.
Index creation should be a maintenance task you execute in demand or otherwise only when you know you need to.
You could swap that for ensureIndex
instead, but that's also recommended to be an on demand task, not an on server start task.
manpreet
Best Answer
2 years ago
my schema:
searching text:
when I start the server it gives the error:
I have tried to drop the index by using
but when I restart the server, it again gives the same error and I can find that index with key _fts and _ftsx are already there.
Which step am I doing wrong? Thanks in advance.
edit: there was this field that I didn't add in the question which was creating the index. I removed it, its working fine.