title: Spring data + MongoTemplate - constraints on document won't affect inserts\saves
body: <p>I'm using spring data in a simple web application.</p>
  
  <p>I have a simple document that has a unique constraint on one of the fields:</p>
  
  <pre><code>@Document
  @CompoundIndexes({ @CompoundIndex(name = "playerConstraint", def = "{ 'playerId': 1  }", unique = true)
  public class InProgressGameRound extends AbstractDocument {
   //...
  }
  </code></pre>
  
  <p>Problem is when i call the repository of that document with:
      this.repository.save(newRound);</p>
  
  <p>where newRound.playerId is already exists in the db - i dont get any exceptions!
  the program counter just moves on and it seems everything is alright even though the document wasnt really saved (because of the constraint)</p>
  
  <p>If i try to manually insert into mongoDB the same entry - i DO get an error that says the constraint is not allowing he insert.</p>
  
  <p>How can i verify if the save worked or not (with the repository)? </p>
  
  <p>Thanks</p>