I have a string field which contains alphanumerics like 00001 J
I need to enable search on this field so I am trying to use the full text index to optimize the searching but it will only allows me to search the string content. So If I try to search the field with J
am getting the document but while trying to search with 000
am not getting that document. Is there any other way to achieve my goal?
Hi @Bhargavi_Kasi - Welcome to the community.
Would the below example suit your use case?
db.coll1.find({text:/000/i})
[
{ _id: ObjectId("62f45b301bbceb4cf25ff2ab"), text: '00001 J' },
{ _id: ObjectId("62f45d981bbceb4cf25ff2ac"), text: '00001J' }
]
If so, please see the following documentation for more details.
Regards,
Jason