<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sethuraman Srinivasan on Medium]]></title>
        <description><![CDATA[Stories by Sethuraman Srinivasan on Medium]]></description>
        <link>https://medium.com/@ramseth001?source=rss-7af6d879366a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*9PDSyQ8CBRBAuDr5.jpg</url>
            <title>Stories by Sethuraman Srinivasan on Medium</title>
            <link>https://medium.com/@ramseth001?source=rss-7af6d879366a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 14:45:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ramseth001/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to perform text based search on MongoDB]]></title>
            <link>https://medium.com/@ramseth001/how-to-perform-text-based-search-on-mongodb-66bdfc1e05e3?source=rss-7af6d879366a------2</link>
            <guid isPermaLink="false">https://medium.com/p/66bdfc1e05e3</guid>
            <category><![CDATA[mongodb]]></category>
            <dc:creator><![CDATA[Sethuraman Srinivasan]]></dc:creator>
            <pubDate>Wed, 22 Mar 2023 10:33:36 GMT</pubDate>
            <atom:updated>2023-03-22T10:33:36.479Z</atom:updated>
            <content:encoded><![CDATA[<p>There are three ways in which text search can be performed in MongoDB collections.</p><ul><li>Familiar REGEX search</li><li>Text-index based search</li><li>MongoDB Atlas Search (only on Atlas hosted MongoDB projects)</li></ul><p>This article explains how to perform <strong>basic logical operations</strong> using text-index based search. When I was searching for those queries, it took me some time to find around the internet. Hence, this article is written to make “finding around” easier.</p><p><strong>A short introduction on text-index:</strong></p><ul><li>In order to search for a text in a particular field or multiple fields, text index can be used.</li><li>Text indexes can include any field whose value is a string or an array of string elements.</li><li>Only disadvantage is that a mongoDB collection can have only one text index.</li><li>For more details on how to create a text index, please refer to the <a href="https://www.mongodb.com/docs/manual/core/index-text/">MongoDB article</a>.</li></ul><p><strong>Logical operations example:</strong></p><ol><li>Single query: <br>- Multiple words search: { “$text”: { “$search”: “\”Ricky Ponting\”” } }<br>- Single word search: { “$text”: { “$search”: “Ricky ” } }</li><li>OR operation: <br>- Multiple words search: { “$text”: { “$search”: “\”Steve Waugh\” \”Ricky Ponting\”” } }<br>- Single word search: { “$text”: { “$search”: “Steve Ricky” } }</li><li>AND operation: <br>- Multiple words search: { “$text”: { “$search”: ‘ “Steve Waugh” “Ricky Ponting” ’ } }<br>- Single word search: { “$text”: { “$search”: ‘ “Steve” “Ricky”’ } }</li><li>NOT operation:<br>{ $text: { $search: “Ricky Ponting” }, field: { $not: { $regex: “regex pattern” } } }</li></ol><p>Note:</p><ul><li>Single word can be searched using <strong>Multiple words search query</strong> pattern. For the sake of simplicity, I’ve added the <strong>Single word search query</strong> pattern.</li><li>For NOT operation, we’ve to rely on regex as well.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66bdfc1e05e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>