title: Syntax error Unexpected token ILLEGAL Mongo Console
body: <p>I'm trying to remove a document from an array <code>threads</code> that is a field in the collection's head document. </p>
  
  <p>In Mongodb console I write following query: </p>
  
  <pre><code>db.inboxes.update({}, { $pull: {threads: {"_id":ObjectId(”5550b41ce7c33013c8000006”)}}})
  </code></pre>
  
  <p>But I keep getting:  </p>
  
  <blockquote>
    <p>Unexpected token ILLEGAL</p>
  </blockquote>
  
  <p>It's driving me crazy. The Collection's schema is as following:</p>
  
  <pre><code>var inboxSchema = mongoose.Schema({
      user: {
          type: mongoose.Schema.ObjectId,
          ref: 'userSchema',
          required: true
      },
      threads: [{
          name: String,
          guid: String,
          with: {
              _id: {
                  type: mongoose.Schema.ObjectId,
                  ref: 'userSchema'
              },
              name: {
                  username: String,
                  firstname: String,
                  lastname: String
              },
              email: {
                  type: String,
                  match: /\S+@\S+\.\S+/
              }
          },
          messages: [{
              heading: String,
              sent: {
                  type: Date,
                  default: Date.now
              },
              from: {
                  type: mongoose.Schema.ObjectId,
                  ref: 'userSchema'
              },
              to: {
                  type: mongoose.Schema.ObjectId,
                  ref: 'userSchema'
              },
              body: String
          }],
          updated: {
              type: Date,
              default: Date.now
          },
          unreadMessage: Boolean
      }]
  });
  </code></pre>