Note that there are some explanatory texts on larger screens.

plurals
  1. POmongodb dies on regex search
    primarykey
    data
    text
    <p>Simple regex search:</p> <pre><code>&gt; db.lipsum.find({"d.text":{$regex:'cursus'}}); </code></pre> <p>does well, and returns many thousands. </p> <p>A bit more complex one:</p> <pre><code>db.lipsum.find({"d.text":{$regex:'cursus((?!turpis massa).)*$'}}); </code></pre> <p>kills the mongod:</p> <pre><code>Tue Nov 26 11:01:03 DBClientCursor::init call() failed Tue Nov 26 11:01:03 query failed : lipsum.lipsum { d.text: { $regex: "cursus((?!turpis massa).)*$" } } to: 127.0.0.1:27017 Error: error doing query: failed Tue Nov 26 11:01:03 trying reconnect to 127.0.0.1:27017 Tue Nov 26 11:01:03 reconnect 127.0.0.1:27017 failed couldn't connect to server 127.0.0.1:27017 </code></pre> <p>There is nothing in mongodb.log. The last lines are:</p> <pre><code>Tue Nov 26 11:00:17 [conn2] query lipsum.lipsum query: { d.text: { $regex: "cursus" } } cursorid:5200338523215960499 ntoreturn:0 keyUpdates:0 locks(micros) r:1266 nreturned:101 reslen:159838 1ms Tue Nov 26 11:00:18 [conn2] run command admin.$cmd { replSetGetStatus: 1.0, forShell: 1.0 } Tue Nov 26 11:00:18 [conn2] command admin.$cmd command: { replSetGetStatus: 1.0, forShell: 1.0 } ntoreturn:1 keyUpdates:0 reslen:76 0ms </code></pre> <p>So there are 2 questions:</p> <ol> <li>How to get detailed information what happened ? </li> <li>How to write correct regex to fetch objects that have no "turpis massa" after "cursus"?</li> </ol> <hr> <p>Mongodb 2.2.4, Ubuntu 13.04.</p> <p>My testing db:</p> <pre><code>load("lorem.js"); // from https://github.com/f/loremjs var lorem = new Lorem; lorem.type = Lorem.TEXT; lorem.query = '2p'; for(var i=0; i &lt; 20000; i++){ db.lipsum.insert({t: $currentDate, d: {text:lorem.createLorem()}}) } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload