title: Spring data MongoDb: MappingMongoConverter remove _class
body: <p>The default <strong>MappingMongoConverter</strong> adds a custom type key ("_class") to each object in the database. So, if I create a Person:</p>
  
  <pre><code>package my.dto;
  public class Person {
      String name;
      public Person(String name) {
          this.name = name; 
      }
  }
  </code></pre>
  
  <p>and save it to the db:</p>
  
  <pre><code>MongoOperations ops = new MongoTemplate(new Mongo(), "users");
  ops.insert(new Person("Joe"));
  </code></pre>
  
  <p>the resulting object in the mongo will be:</p>
  
  <pre><code>{ "_id" : ObjectId("4e2ca049744e664eba9d1e11"), "_class" : "my.dto.Person", "name" : "Joe" }
  </code></pre>
  
  <p><strong>Questions:</strong></p>
  
  <ol>
  <li><p>What are the implications of moving the Person class into a different namespace?</p></li>
  <li><p>Is it possible not to pollute the object with the "_class" key; without writing a unique converter just for the Person class?</p></li>
  </ol>