title: How to use lift-json's class extractor constructor mongo bson array?
body: <p>I'm use lift-json render a bson string with class extractor, after that, use mongo <code>Document</code> class constructor a document instance with that bson string.  </p>
  
  <p>A problem is how about represent <code>$or</code> bson.It seems not a classic json array.</p>
  
  <pre><code> {"$or": [
        {"username": "administrator"},
        {"phone":"110"},
        {"email":"123@xxx.com"},
        {"pen_name":"lorancechen"}
   ]}
  </code></pre>
  
  <p>How to use lift class extractor represent this bson array?</p>
  
  <p>Besides, the reason of use string between app and mongo is they are communicate under a simple socket.</p>
  
  <p><strong>UPDATE</strong> add a example<br>
  extractor a normal array class as follow:</p>
  
  <pre><code>import net.liftweb.json._
  import net.liftweb.json.Extraction._
  
  case class Name(name: String)
  case class JsonArray(array:List[Name])
  
  object JsonClient extends App {
    implicit val formats = DefaultFormats
  
    val names = Name("jone01") :: Name("jone02") :: Nil
    val array = JsonArray(names)
    val jsonString = prettyRender(decompose(array))
    println(jsonString)
  }
  </code></pre>
  
  <p>OUTPUT:</p>
  
  <pre><code>{
    "array":[
      {
        "name":"jone01"
      },
      {
        "name":"jone02"
      }
    ]
  }
  </code></pre>
  
  <p>How to represent this</p>
  
  <pre><code>{"$or": [
        {"username": "administrator"},
        {"phone":"110"},
        {"email":"123@xxx.com"},
        {"pen_name":"lorancechen"}
   ]}
  </code></pre>
  
  <p>every field key (eg, <code>username</code>, <code>phone</code>) of element inner "$or" is not common key name and I haven't find a way to represent it use class template. </p>