title: Couchbase: How to create JsonObject from a java Object
body: <p>How to easily convert/parse the Java Object into a JSON object that is a instance com.couchbase.client.java.document.json.JsonObject?</p>
  
  <p>I tried to do this:</p>
  
  <pre><code>import com.couchbase.client.deps.com.fasterxml.jackson.annotation.JsonProperty;
  
  public class MyClass {
  
  @JsonProperty("filed")
  private String filed;
  
  public MyClass(String filed) {
      this.filed = filed;
  }
  
  public String getFiled() {
      return filed;
  }
  </code></pre>
  
  <p>and run this lines with imports:</p>
  
  <pre><code>    import com.couchbase.client.deps.com.fasterxml.jackson.databind.ObjectMapper;
      import com.couchbase.client.java.document.json.JsonObject;
  
      ObjectMapper mapper = new ObjectMapper();
      MyClass test = new MyClass("a");
      JsonObject node = mapper.convertValue(test, JsonObject.class);
  </code></pre>
  
  <p>and I get:</p>
  
  <pre><code>    java.lang.IllegalArgumentException: Unrecognized field "filed" (class com.couchbase.client.java.document.json.JsonObject), not marked as ignorable (one known property: "names"])
       at [Source: N/A; line: -1, column: -1] (through reference chain: com.couchbase.client.java.document.json.JsonObject["filed"])
  at com.couchbase.client.deps.com.fasterxml.jackson.databind.ObjectMapper._convert(ObjectMapper.java:2759)
  at com.couchbase.client.deps.com.fasterxml.jackson.databind.ObjectMapper.convertValue(ObjectMapper.java:2685)
  </code></pre>