Hi Mohit,
I need to find the substring of this string
of this thing I need to display only “JUSTPATERSON.CO.NZ”
Can i get a response in which i will not have to write index?
like find from string ABC: Between: content=”Web technologies && is using on their website.”
Do we have a solution in mongodb??
You posted similar topics in https://groups.google.com/forum/#!topic/mongodb-user/HzjsFE-sqS8 and https://groups.google.com/forum/#!topic/mongodb-user/pd1vXRcQ2WY. I will try to answer them in this post as well.
MongoDB $regex
queries uses regular expression to return documents with field matching a given regular expression as a query condition, but does not support regex-based projection or other string manipulation to return part of a match. Please see the following links for more information:
The main issue that I understand so far is that your current document structure contains the whole HTML page as a string under a single field. To return the data in the form that you require, you would need to use a post-processing step in your application after you have found the desired document in your MongoDB database.
Another method you could consider is to perform pre-processing of the HTML data using a HTML parser before inserting the data into MongoDB, so you can put the information of interest into a specific field.
Best regards,
Kevin