× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

How to query mongodb with "like"?

Feb 18, 2015
<p>You can use the new feature of 2.6 mongodb:</p> <pre><code>db.foo.insert({desc: "This is a string with text"}); db.foo.insert({desc:"This is a another string with Text"}); db.foo.ensureIndex({"desc":"text"}); db.foo.find({ $text:{ $search:"text" } }); </code></pre> <p>This tip was originally posted on <a href="http://stackoverflow.com/questions/3305561/How%20to%20query%20mongodb%20with%20%22like%22?/25125945">Stack Overflow</a>.</p>
comments powered by Disqus